88. Merge Sorted Array 合并两个有序数组 89. Gray Code 格雷编码 90. Subsets II 子集 II 91. Decode Ways 解码方法 92. Reverse Linked List II 反转链表 II 93. Restore IP Addresses 复原 IP 地址 94. Binary Tree Inorder Traversal 二叉树的中序遍
Problem Statement dp[i][j]: the number of subsets of A[0, i] whose sum is j. dp[0][0] = 1, there is only 1 way of not picking anything from an empty array to achieve sum 0. Answer is dp[N][S] State Transition: case 1, not using A[i] : all the subsets of A[0, i...
1334 Find the City With the Smallest Number of Neighbors at a Threshold Distance 57.70% Medium 1333 "Filter Restaurants by Vegan-Friendly Price and Distance" 60.50% 1332 Remove Palindromic Subsequences 76.20% Easy 1331 Rank Transform of an Array 59.80% Easy 1330 Reverse Subarray To Maximize Array...
629 K Inverse Pairs Array Hard 23.90% 630 Course Schedule III Medium 20.50% 631 Design Excel Sum Formula $ Hard 25.60% 632 Smallest Range Hard 42.80% 633 Sum of Square Numbers Easy 31.60% 634 Find the Derangement of An Array $ Medium 32.70% 635 Design Log Storage System $ Medium 47.70% ...
LeetCode 398. Random Pick Index LC address:398. Random Pick Index Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array. ...
0078-subsets Time: 1 ms (57.66%), Space: 42.8 MB (26.76%) - LeetHub May 22, 2024 0079-word-search Time: 218 ms (20.70%), Space: 45.2 MB (9.18%) - LeetHub Apr 3, 2024 0081-search-in-rotated-sorted-array-ii Time: 0 ms (100.00%), Space: 42.6 MB (93.61%) - LeetHub Sep...
终于将LeetCode的免费题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 如果各位看官们,大神们发现了任何错误,或是代码无法通过OJ,或是有更好的解法,或是有任何疑问,意见和建议的话,请一定要
698 划分为k个相等的子集 - Partition to K Equal Sum Subsets C++ Java Python3 Medium 697 数组的度 - Degree of an Array C++ Java Python3 Easy 696 计数二进制子串 - Count Binary Substrings C++ Java Python3 Easy 695 岛屿的最大面积 - Max Area of Island C++ Java Python3 Medium 694 C++ Jav...
1334 Find the City With the Smallest Number of Neighbors at a Threshold Distance 57.70% Medium 1333 Filter Restaurants by Vegan-Friendly, Price and Distance 60.50% Medium 1332 Remove Palindromic Subsequences 76.20% Easy 1331 Rank Transform of an Array 59.80% Easy 1330 Reverse Subarray To Maximize ...
search in an array 090.Subsets-II (M+) 301.Remove-Invalid-Parentheses (H) 473.Matchsticks-to-Square (M+) 491.Increasing-Subsequences (M) 698.Partition-to-K-Equal-Sum-Subsets (H-) 996.Number-of-Squareful-Arrays (H-) 1307.Verbal-Arithmetic-Puzzle (H) 1593.Split-a-String-Into-the-Max...