https://leetcode.com/problems/squares-of-a-sorted-array/ 3. Pattern: Fast & Slow pointers,快慢指针类型 这种模式,有一个非常出门的名字,叫龟兔赛跑。咱们肯定都知道龟兔赛跑啦。但还是再解释一下快慢指针:这种算法的两个指针的在数组上(或是链表上,序列上)的移动速度不一样。还别说,这种方法在解决有环...
416 partition-equal-subset-sum 📝 Medium 417 pacific-atlantic-water-flow 📝 Medium 418 sentence-screen-fitting 🔒 Medium 419 battleships-in-a-board Medium 420 strong-password-checker Hard 421 maximum-xor-of-two-numbers-in-an-array 📝 Medium 422 valid-word-square 🔒 Easy 423 reconstruct...
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...
Leetcode 1300. Sum of Mutated Array Closest to Target Leetcode 1060. Missing Element in Sorted Array Leetcode 1062. Longest Repeating Substring Leetcode 1891. Cutting Ribbons Leetcode 410. Split Array Largest Sum (与1891类似) 双指针(2 Pointer): 基础知识:常见双指针算法分为三类,同向(即两个指...
四:题目描述:给定一个整数,编写一个函数来判断它是否是 2 的幂次方。boolisPowerOfTwo(intn){...
链接:https://leetcode-cn.com/problems/people-whose-list-of-favorite-companies-is-not-a-subset-of-another-list 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。 第二次做周赛的题,我目前只能想到一个思路,代码可以通过,如果有更好的思路我之后再补充。首先我写了一个helper函数帮助判...
1154 Day of the Year 50.10% Easy 1153 String Transforms Into Another String $ 35.60% Hard 1152 Analyze User Website Visit Pattern $ 43.20% Medium 1151 Minimum Swaps to Group All 1's Together $ 51.90% Medium 1150 Check If a Number Is Majority Element in a Sorted Array $ 57.10% Easy 114...
[LeetCode] 1452. People Whose List of Favorite Companies Is Not a Subset of Another List,Giventhearray favoriteCompanies where favoriteCompanies[i] isthelistoffavoritescompaniesforthe ith person(indexedfrom0).Returntheindice
368 Largest Divisible Subset // #368 最大整除子集 描述:给定一个集合,找出最大的子集,使得子集中任意两数都有整除关系。 //#368Description: Largest Divisible Subset | LeetCode OJ 解法1:DP. // Solution 1: DP. 代码1 //Code 1 369 Plus One Linked List ...
416Partition Equal Subset SumMiddle 4Median of Two Sorted ArraysMiddle 121Best Time to Buy and Sell StockEasy 581Shortest Unsorted Continuous SubarrayEasy 70Climbing StairsEasy 437Path Sum IIIMiddle *198House RobberEasy 2Add Two NumbersEasy 15Three SumEasy 448Find All Numbers Disappeared in an Arra...