https://leetcode.com/problems/peak-index-in-a-mountain-array/ https://leetcode.com/problems/search-in-rotated-sorted-array/ https://leetcode.com/problems/search-a-2d-matrix/ https://leetcode.com/problems/search-in-rotated-sorted-array-ii/ https://leetcode.com/problems/find-minimum-in-r...
Sum of Mutated Array Closest to Target Leetcode 1060. Missing Element in Sorted Array 双指针(2 Pointer): 基础知识:常见双指针算法分为三类,同向(即两个指针都相同一个方向移动),背向(两个指针从相同或者相邻的位置出发,背向移动直到其中一根指针到达边界为止),相向(两个指针从两边出发一起向中间移动直到...
108. 将有序数组转换为二叉搜索树 Convert Sorted Array to Binary Search Tree【LeetCode 力扣官方题解】 1151 -- 4:45 App 151. 翻转字符串里的单词 Reverse Words in a String 【LeetCode 力扣官方题解】 1386 7 7:23 App 225. 用队列实现栈 Implement Stack using Queues 【LeetCode 力扣官方题解】...
1498.Number-of-Subsequences-That-Satisfy-the-Given-Sum-Condition (H-) 1574.Shortest-Subarray-to-be-Removed-to-Make-Array-Sorted (H-) 1580.Put-Boxes-Into-the-Warehouse-II (H-) 1687.Delivering-Boxes-from-Storage-to-Ports (H) 1793.Maximum-Score-of-a-Good-Subarray (M+) 1989.Maximum-Number...
Partition Equal Subset Sum 【题目】Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. Note: Each of the array element will not exceed 100. The array size will not...
链接:https://leetcode-cn.com/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 第二次做周赛的题,我目前只能想到一个思路,代码可以通过,如果有更好的思路我之后再补充。首先我写了一个helper函数帮助判...
Do not allocate extra space for another array, you must do this in place with constant memory. For example,Given input array A = [1,1,2], Your function should return length = 2, and A is now [1,2]. 【解答】双指针: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19...
1452 People Whose List of Favorite Companies Is Not a Subset of Another List Medium Solution 1453 Maximum Number of Darts Inside of a Circular Dartboard Hard Solution 1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Easy Solution 1456 Maximum Number of Vowels in a Substrin...
646. Maximum Length of Pair Chain(Medium) You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow another pair (a, b) if and only if b < c. Chain of pairs can be formed in this fas...
368 Largest Divisible Subset Solution O(n^2) O(n) Medium DP 369 Plus One Linked List Solution O(n) O(1) Medium Linked List 370 Range Addition Solution O(n+k) O(1) Medium Array 371 Sum of Two Integers Solution O(n) O(1) Easy 372 Super Pow Solution O(n) O(1) Medium Math ...