随笔分类 - LeetCode
摘要:Rotate Array (E) 题目 Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: [1,2,3,4,5,6,7] and k = 3 Out
阅读全文
摘要:Sort List (M) 题目 Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: Inp
阅读全文
摘要:Buddy Strings (E) 题目 Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwi
阅读全文
摘要:Remove Duplicate Letters (M) 题目 Given a string s, remove duplicate letters so that every letter appears once and only once. You must make sure your re
阅读全文
摘要:Minimum Number of Arrows to Burst Balloons (M) 题目 There are some spherical balloons spread in two-dimensional space. For each balloon, provided input
阅读全文
摘要:Serialize and Deserialize BST (M) 题目 Serialization is converting a data structure or object into a sequence of bits so that it can be stored in a file
阅读全文
摘要:Binary Search (E) 题目 Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in num
阅读全文
摘要:Insert into a Binary Search Tree (M) 题目 You are given the root node of a binary search tree (BST) and a value to insert into the tree. Return the root
阅读全文
摘要:Complement of Base 10 Integer (E) 题目 Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 1
阅读全文
摘要:Remove Covered Intervals (M) 题目 Given a list of intervals, remove all intervals that are covered by another interval in the list. Interval [a,b) is co
阅读全文
摘要:K-diff Pairs in an Array (M) 题目 Given an array of integers nums and an integer k, return the number of unique k-diff pairs in the array. A k-diff pair
阅读全文
摘要:Number of Recent Calls (E) 题目 You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the Rec
阅读全文
摘要:Word Break (M) 题目 Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a sp
阅读全文
摘要:Subarray Product Less Than K (M) 题目 Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the
阅读全文
摘要:Evaluate Division (M) 题目 You are given equations in the format A / B = k, where A and B are variables represented as strings, and k is a real number (
阅读全文
摘要:Teemo Attacking (M) 题目 In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the T
阅读全文
摘要:Largest Number (M) 题目 Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "21
阅读全文
摘要:Find the Difference (E) 题目 Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and t
阅读全文
摘要:Gas Station (M) 题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited g
阅读全文
摘要:Majority Element II (M) 题目 Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in
阅读全文

浙公网安备 33010602011771号