diff --git a/01-two-sum/solution.py b/01-two-sum/solution.py deleted file mode 100644 index 2c4e4e6..0000000 --- a/01-two-sum/solution.py +++ /dev/null @@ -1,15 +0,0 @@ -from typing import List - -class Solution: - def twoSum(self, nums: List[int], target: int) -> List[int]: - hash = {} - for i, num in enumerate(nums): - another = target - num - if another in hash: - return [hash[another], i] - hash[num] = i - - -if __name__ == "__main__": - res = Solution().twoSum([2,7,11,15], 9) - print(res) diff --git a/3sum/solution.py b/3sum/solution.py new file mode 100644 index 0000000..3ac2594 --- /dev/null +++ b/3sum/solution.py @@ -0,0 +1,37 @@ +# https://leetcode.cn/problems/3sum/ + + +class Solution: + def threeSum(self, nums: list[int]) -> list[list[int]]: + n = len(nums) + res = [] + nums.sort() + + for i in range(n - 2): + if i > 0 and nums[i] == nums[i - 1]: + continue + left, right = i + 1, n - 1 + if nums[i] > 0 or nums[right] < 0: + continue + while left < right: + sum = nums[i] + nums[left] + nums[right] + if sum > 0: + right -= 1 + elif sum < 0: + left += 1 + continue + if sum == 0: + res.append([nums[i], nums[left], nums[right]]) + left += 1 + while left < right and nums[left - 1] == nums[left]: + left += 1 + right -= 1 + while left < right and nums[right] == nums[right + 1]: + right -= 1 + + return res + + +if __name__ == "__main__": + res = Solution().threeSum([-1, 0, 1, 2, -1, -4]) + print(res) diff --git a/README.md b/README.md new file mode 100644 index 0000000..ea8d0fd --- /dev/null +++ b/README.md @@ -0,0 +1,100 @@ +- [ ] [排序链表](https://leetcode.cn/problems/sort-list/) +- [ ] [最长有效括号](https://leetcode.cn/problems/longest-valid-parentheses/) +- [ ] [颜色分类](https://leetcode.cn/problems/sort-colors/) +- [ ] [验证二叉搜索树](https://leetcode.cn/problems/validate-binary-search-tree/) +- [ ] [搜索插入位置](https://leetcode.cn/problems/search-insert-position/) +- [ ] [最小栈](https://leetcode.cn/problems/min-stack/) +- [ ] [有效的括号](https://leetcode.cn/problems/valid-parentheses/) +- [ ] [二叉树的右视图](https://leetcode.cn/problems/binary-tree-right-side-view/) +- [ ] [二叉树的中序遍历](https://leetcode.cn/problems/binary-tree-inorder-traversal/) +- [ ] [将有序数组转换为二叉搜索树](https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/) +- [ ] [矩阵置零](https://leetcode.cn/problems/set-matrix-zeroes/) +- [ ] [两两交换链表中的节点](https://leetcode.cn/problems/swap-nodes-in-pairs/) +- [ ] [最长公共子序列](https://leetcode.cn/problems/longest-common-subsequence/) +- [ ] [搜索二维矩阵 II](https://leetcode.cn/problems/search-a-2d-matrix-ii/) +- [ ] [编辑距离](https://leetcode.cn/problems/edit-distance/) +- [ ] [划分字母区间](https://leetcode.cn/problems/partition-labels/) +- [ ] [电话号码的字母组合](https://leetcode.cn/problems/letter-combinations-of-a-phone-number/) +- [ ] [二叉树展开为链表](https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/) +- [ ] [反转链表](https://leetcode.cn/problems/reverse-linked-list/) +- [ ] [移动零](https://leetcode.cn/problems/move-zeroes/) +- [ ] [完全平方数](https://leetcode.cn/problems/perfect-squares/) +- [ ] [删除链表的倒数第 N 个结点](https://leetcode.cn/problems/remove-nth-node-from-end-of-list/) +- [ ] [最大子数组和](https://leetcode.cn/problems/maximum-subarray/) +- [ ] [两数相加](https://leetcode.cn/problems/add-two-numbers/) +- [ ] [分割等和子集](https://leetcode.cn/problems/partition-equal-subset-sum/) +- [ ] [搜索二维矩阵](https://leetcode.cn/problems/search-a-2d-matrix/) +- [ ] [下一个排列](https://leetcode.cn/problems/next-permutation/) +- [ ] [数组中的第K个最大元素](https://leetcode.cn/problems/kth-largest-element-in-an-array/) +- [ ] [岛屿数量](https://leetcode.cn/problems/number-of-islands/) +- [ ] [K 个一组翻转链表](https://leetcode.cn/problems/reverse-nodes-in-k-group/) +- [ ] [买卖股票的最佳时机](https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/) +- [ ] [在排序数组中查找元素的第一个和最后一个位置](https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/) +- [ ] [柱状图中最大的矩形](https://leetcode.cn/problems/largest-rectangle-in-histogram/) +- [ ] [寻找重复数](https://leetcode.cn/problems/find-the-duplicate-number/) +- [ ] [二叉搜索树中第 K 小的元素](https://leetcode.cn/problems/kth-smallest-element-in-a-bst/) +- [ ] [实现 Trie (前缀树)](https://leetcode.cn/problems/implement-trie-prefix-tree/) +- [ ] [最小覆盖子串](https://leetcode.cn/problems/minimum-window-substring/) +- [ ] [只出现一次的数字](https://leetcode.cn/problems/single-number/) +- [ ] [二叉树的直径](https://leetcode.cn/problems/diameter-of-binary-tree/) +- [ ] [旋转图像](https://leetcode.cn/problems/rotate-image/) +- [ ] [搜索旋转排序数组](https://leetcode.cn/problems/search-in-rotated-sorted-array/) +- [ ] [合并区间](https://leetcode.cn/problems/merge-intervals/) +- [ ] [轮转数组](https://leetcode.cn/problems/rotate-array/) +- [ ] [二叉树的最大深度](https://leetcode.cn/problems/maximum-depth-of-binary-tree/) +- [ ] [除了自身以外数组的乘积](https://leetcode.cn/problems/product-of-array-except-self/) +- [ ] [路径总和 III](https://leetcode.cn/problems/path-sum-iii/) +- [ ] [爬楼梯](https://leetcode.cn/problems/climbing-stairs/) +- [ ] [组合总和](https://leetcode.cn/problems/combination-sum/) +- [ ] [合并 K 个升序链表](https://leetcode.cn/problems/merge-k-sorted-lists/) +- [ ] [子集](https://leetcode.cn/problems/subsets/) +- [ ] [找到字符串中所有字母异位词](https://leetcode.cn/problems/find-all-anagrams-in-a-string/) +- [ ] [课程表](https://leetcode.cn/problems/course-schedule/) +- [ ] [数据流的中位数](https://leetcode.cn/problems/find-median-from-data-stream/) +- [ ] [杨辉三角](https://leetcode.cn/problems/pascals-triangle/) +- [ ] [盛最多水的容器](https://leetcode.cn/problems/container-with-most-water/) +- [ ] [字符串解码](https://leetcode.cn/problems/decode-string/) +- [ ] [跳跃游戏 II](https://leetcode.cn/problems/jump-game-ii/) +- [ ] [不同路径](https://leetcode.cn/problems/unique-paths/) +- [ ] [接雨水](https://leetcode.cn/problems/trapping-rain-water/) +- [ ] [环形链表](https://leetcode.cn/problems/linked-list-cycle/) +- [ ] [和为 K 的子数组](https://leetcode.cn/problems/subarray-sum-equals-k/) +- [ ] [翻转二叉树](https://leetcode.cn/problems/invert-binary-tree/) +- [ ] [无重复字符的最长子串](https://leetcode.cn/problems/longest-substring-without-repeating-characters/) +- [ ] [相交链表](https://leetcode.cn/problems/intersection-of-two-linked-lists/) +- [ ] [前 K 个高频元素](https://leetcode.cn/problems/top-k-frequent-elements/) +- [ ] [分割回文串](https://leetcode.cn/problems/palindrome-partitioning/) +- [ ] [螺旋矩阵](https://leetcode.cn/problems/spiral-matrix/) +- [ ] [二叉树的层序遍历](https://leetcode.cn/problems/binary-tree-level-order-traversal/) +- [ ] [对称二叉树](https://leetcode.cn/problems/symmetric-tree/) +- [ ] [两数之和](https://leetcode.cn/problems/two-sum/) +- [ ] [环形链表 II](https://leetcode.cn/problems/linked-list-cycle-ii/) +- [ ] [最长回文子串](https://leetcode.cn/problems/longest-palindromic-substring/) +- [ ] [单词搜索](https://leetcode.cn/problems/word-search/) +- [ ] [随机链表的复制](https://leetcode.cn/problems/copy-list-with-random-pointer/) +- [ ] [每日温度](https://leetcode.cn/problems/daily-temperatures/) +- [ ] [从前序与中序遍历序列构造二叉树](https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) +- [ ] [乘积最大子数组](https://leetcode.cn/problems/maximum-product-subarray/) +- [ ] [跳跃游戏](https://leetcode.cn/problems/jump-game/) +- [ ] [字母异位词分组](https://leetcode.cn/problems/group-anagrams/) +- [ ] [打家劫舍](https://leetcode.cn/problems/house-robber/) +- [ ] [零钱兑换](https://leetcode.cn/problems/coin-change/) +- [ ] [N 皇后](https://leetcode.cn/problems/n-queens/) +- [ ] [寻找旋转排序数组中的最小值](https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/) +- [ ] [单词拆分](https://leetcode.cn/problems/word-break/) +- [ ] [滑动窗口最大值](https://leetcode.cn/problems/sliding-window-maximum/) +- [ ] [最长递增子序列](https://leetcode.cn/problems/longest-increasing-subsequence/) +- [ ] [最长连续序列](https://leetcode.cn/problems/longest-consecutive-sequence/) +- [ ] [全排列](https://leetcode.cn/problems/permutations/) +- [ ] [回文链表](https://leetcode.cn/problems/palindrome-linked-list/) +- [ ] [最小路径和](https://leetcode.cn/problems/minimum-path-sum/) +- [ ] [LRU 缓存](https://leetcode.cn/problems/lru-cache/) +- [ ] [合并两个有序链表](https://leetcode.cn/problems/merge-two-sorted-lists/) +- [ ] [三数之和](https://leetcode.cn/problems/3sum/) +- [ ] [寻找两个正序数组的中位数](https://leetcode.cn/problems/median-of-two-sorted-arrays/) +- [ ] [二叉树的最近公共祖先](https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/) +- [ ] [括号生成](https://leetcode.cn/problems/generate-parentheses/) +- [ ] [多数元素](https://leetcode.cn/problems/majority-element/) +- [ ] [腐烂的橘子](https://leetcode.cn/problems/rotting-oranges/) +- [ ] [二叉树中的最大路径和](https://leetcode.cn/problems/binary-tree-maximum-path-sum/) +- [ ] [缺失的第一个正数](https://leetcode.cn/problems/first-missing-positive/) diff --git a/add-two-numbers/solution.py b/add-two-numbers/solution.py new file mode 100644 index 0000000..9d1b2cb --- /dev/null +++ b/add-two-numbers/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/add-two-numbers/ +if __name__ == "__main__": + pass diff --git a/best-time-to-buy-and-sell-stock/solution.py b/best-time-to-buy-and-sell-stock/solution.py new file mode 100644 index 0000000..edff74e --- /dev/null +++ b/best-time-to-buy-and-sell-stock/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/ +if __name__ == "__main__": + pass diff --git a/binary-tree-inorder-traversal/solution.py b/binary-tree-inorder-traversal/solution.py new file mode 100644 index 0000000..01d1848 --- /dev/null +++ b/binary-tree-inorder-traversal/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/binary-tree-inorder-traversal/ +if __name__ == "__main__": + pass diff --git a/binary-tree-level-order-traversal/solution.py b/binary-tree-level-order-traversal/solution.py new file mode 100644 index 0000000..46595b5 --- /dev/null +++ b/binary-tree-level-order-traversal/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/binary-tree-level-order-traversal/ +if __name__ == "__main__": + pass diff --git a/binary-tree-maximum-path-sum/solution.py b/binary-tree-maximum-path-sum/solution.py new file mode 100644 index 0000000..6e926a9 --- /dev/null +++ b/binary-tree-maximum-path-sum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/binary-tree-maximum-path-sum/ +if __name__ == "__main__": + pass diff --git a/binary-tree-right-side-view/solution.py b/binary-tree-right-side-view/solution.py new file mode 100644 index 0000000..9455b9d --- /dev/null +++ b/binary-tree-right-side-view/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/binary-tree-right-side-view/ +if __name__ == "__main__": + pass diff --git a/climbing-stairs/solution.py b/climbing-stairs/solution.py new file mode 100644 index 0000000..447d8eb --- /dev/null +++ b/climbing-stairs/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/climbing-stairs/ +if __name__ == "__main__": + pass diff --git a/coin-change/solution.py b/coin-change/solution.py new file mode 100644 index 0000000..9be9ae2 --- /dev/null +++ b/coin-change/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/coin-change/ +if __name__ == "__main__": + pass diff --git a/combination-sum/solution.py b/combination-sum/solution.py new file mode 100644 index 0000000..10f2b4f --- /dev/null +++ b/combination-sum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/combination-sum/ +if __name__ == "__main__": + pass diff --git a/construct-binary-tree-from-preorder-and-inorder-traversal/solution.py b/construct-binary-tree-from-preorder-and-inorder-traversal/solution.py new file mode 100644 index 0000000..92787cb --- /dev/null +++ b/construct-binary-tree-from-preorder-and-inorder-traversal/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ +if __name__ == "__main__": + pass diff --git a/container-with-most-water/solution.py b/container-with-most-water/solution.py new file mode 100644 index 0000000..8b8803e --- /dev/null +++ b/container-with-most-water/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/container-with-most-water/ +if __name__ == "__main__": + pass diff --git a/convert-sorted-array-to-binary-search-tree/solution.py b/convert-sorted-array-to-binary-search-tree/solution.py new file mode 100644 index 0000000..26e9563 --- /dev/null +++ b/convert-sorted-array-to-binary-search-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/ +if __name__ == "__main__": + pass diff --git a/copy-list-with-random-pointer/solution.py b/copy-list-with-random-pointer/solution.py new file mode 100644 index 0000000..0e9990f --- /dev/null +++ b/copy-list-with-random-pointer/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/copy-list-with-random-pointer/ +if __name__ == "__main__": + pass diff --git a/course-schedule/solution.py b/course-schedule/solution.py new file mode 100644 index 0000000..4c6dd94 --- /dev/null +++ b/course-schedule/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/course-schedule/ +if __name__ == "__main__": + pass diff --git a/daily-temperatures/solution.py b/daily-temperatures/solution.py new file mode 100644 index 0000000..45f9fea --- /dev/null +++ b/daily-temperatures/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/daily-temperatures/ +if __name__ == "__main__": + pass diff --git a/decode-string/solution.py b/decode-string/solution.py new file mode 100644 index 0000000..95112dd --- /dev/null +++ b/decode-string/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/decode-string/ +if __name__ == "__main__": + pass diff --git a/diameter-of-binary-tree/solution.py b/diameter-of-binary-tree/solution.py new file mode 100644 index 0000000..56a7b74 --- /dev/null +++ b/diameter-of-binary-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/diameter-of-binary-tree/ +if __name__ == "__main__": + pass diff --git a/edit-distance/solution.py b/edit-distance/solution.py new file mode 100644 index 0000000..6767629 --- /dev/null +++ b/edit-distance/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/edit-distance/ +if __name__ == "__main__": + pass diff --git a/find-all-anagrams-in-a-string/solution.py b/find-all-anagrams-in-a-string/solution.py new file mode 100644 index 0000000..8067b8e --- /dev/null +++ b/find-all-anagrams-in-a-string/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/find-all-anagrams-in-a-string/ +if __name__ == "__main__": + pass diff --git a/find-first-and-last-position-of-element-in-sorted-array/solution.py b/find-first-and-last-position-of-element-in-sorted-array/solution.py new file mode 100644 index 0000000..1396556 --- /dev/null +++ b/find-first-and-last-position-of-element-in-sorted-array/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/ +if __name__ == "__main__": + pass diff --git a/find-median-from-data-stream/solution.py b/find-median-from-data-stream/solution.py new file mode 100644 index 0000000..1e12c8e --- /dev/null +++ b/find-median-from-data-stream/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/find-median-from-data-stream/ +if __name__ == "__main__": + pass diff --git a/find-minimum-in-rotated-sorted-array/solution.py b/find-minimum-in-rotated-sorted-array/solution.py new file mode 100644 index 0000000..62e94e7 --- /dev/null +++ b/find-minimum-in-rotated-sorted-array/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/ +if __name__ == "__main__": + pass diff --git a/find-the-duplicate-number/solution.py b/find-the-duplicate-number/solution.py new file mode 100644 index 0000000..805114b --- /dev/null +++ b/find-the-duplicate-number/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/find-the-duplicate-number/ +if __name__ == "__main__": + pass diff --git a/first-missing-positive/solution.py b/first-missing-positive/solution.py new file mode 100644 index 0000000..ef1254c --- /dev/null +++ b/first-missing-positive/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/first-missing-positive/ +if __name__ == "__main__": + pass diff --git a/flatten-binary-tree-to-linked-list/solution.py b/flatten-binary-tree-to-linked-list/solution.py new file mode 100644 index 0000000..5f3bdad --- /dev/null +++ b/flatten-binary-tree-to-linked-list/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/ +if __name__ == "__main__": + pass diff --git a/generate-parentheses/solution.py b/generate-parentheses/solution.py new file mode 100644 index 0000000..7218530 --- /dev/null +++ b/generate-parentheses/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/generate-parentheses/ +if __name__ == "__main__": + pass diff --git a/group-anagrams/solution.py b/group-anagrams/solution.py new file mode 100644 index 0000000..48de811 --- /dev/null +++ b/group-anagrams/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/group-anagrams/ +if __name__ == "__main__": + pass diff --git a/house-robber/solution.py b/house-robber/solution.py new file mode 100644 index 0000000..932fd3f --- /dev/null +++ b/house-robber/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/house-robber/ +if __name__ == "__main__": + pass diff --git a/implement-trie-prefix-tree/solution.py b/implement-trie-prefix-tree/solution.py new file mode 100644 index 0000000..f4b1a00 --- /dev/null +++ b/implement-trie-prefix-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/implement-trie-prefix-tree/ +if __name__ == "__main__": + pass diff --git a/intersection-of-two-linked-lists/solution.py b/intersection-of-two-linked-lists/solution.py new file mode 100644 index 0000000..d3bc771 --- /dev/null +++ b/intersection-of-two-linked-lists/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/intersection-of-two-linked-lists/ +if __name__ == "__main__": + pass diff --git a/invert-binary-tree/solution.py b/invert-binary-tree/solution.py new file mode 100644 index 0000000..b09f028 --- /dev/null +++ b/invert-binary-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/invert-binary-tree/ +if __name__ == "__main__": + pass diff --git a/jump-game-ii/solution.py b/jump-game-ii/solution.py new file mode 100644 index 0000000..8a49936 --- /dev/null +++ b/jump-game-ii/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/jump-game-ii/ +if __name__ == "__main__": + pass diff --git a/jump-game/solution.py b/jump-game/solution.py new file mode 100644 index 0000000..ce9b5b3 --- /dev/null +++ b/jump-game/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/jump-game/ +if __name__ == "__main__": + pass diff --git a/kth-largest-element-in-an-array/solution.py b/kth-largest-element-in-an-array/solution.py new file mode 100644 index 0000000..5e798a3 --- /dev/null +++ b/kth-largest-element-in-an-array/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/kth-largest-element-in-an-array/ +if __name__ == "__main__": + pass diff --git a/kth-smallest-element-in-a-bst/solution.py b/kth-smallest-element-in-a-bst/solution.py new file mode 100644 index 0000000..936c94e --- /dev/null +++ b/kth-smallest-element-in-a-bst/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/kth-smallest-element-in-a-bst/ +if __name__ == "__main__": + pass diff --git a/largest-rectangle-in-histogram/solution.py b/largest-rectangle-in-histogram/solution.py new file mode 100644 index 0000000..e9d6889 --- /dev/null +++ b/largest-rectangle-in-histogram/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/largest-rectangle-in-histogram/ +if __name__ == "__main__": + pass diff --git a/letter-combinations-of-a-phone-number/solution.py b/letter-combinations-of-a-phone-number/solution.py new file mode 100644 index 0000000..8d62bdc --- /dev/null +++ b/letter-combinations-of-a-phone-number/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/letter-combinations-of-a-phone-number/ +if __name__ == "__main__": + pass diff --git a/linked-list-cycle-ii/solution.py b/linked-list-cycle-ii/solution.py new file mode 100644 index 0000000..ea99901 --- /dev/null +++ b/linked-list-cycle-ii/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/linked-list-cycle-ii/ +if __name__ == "__main__": + pass diff --git a/linked-list-cycle/solution.py b/linked-list-cycle/solution.py new file mode 100644 index 0000000..0e374fc --- /dev/null +++ b/linked-list-cycle/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/linked-list-cycle/ +if __name__ == "__main__": + pass diff --git a/longest-common-subsequence/solution.py b/longest-common-subsequence/solution.py new file mode 100644 index 0000000..003a5d7 --- /dev/null +++ b/longest-common-subsequence/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-common-subsequence/ +if __name__ == "__main__": + pass diff --git a/longest-consecutive-sequence/solution.py b/longest-consecutive-sequence/solution.py new file mode 100644 index 0000000..5d018b7 --- /dev/null +++ b/longest-consecutive-sequence/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-consecutive-sequence/ +if __name__ == "__main__": + pass diff --git a/longest-increasing-subsequence/solution.py b/longest-increasing-subsequence/solution.py new file mode 100644 index 0000000..5e7be3c --- /dev/null +++ b/longest-increasing-subsequence/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-increasing-subsequence/ +if __name__ == "__main__": + pass diff --git a/longest-palindromic-substring/solution.py b/longest-palindromic-substring/solution.py new file mode 100644 index 0000000..12f16e0 --- /dev/null +++ b/longest-palindromic-substring/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-palindromic-substring/ +if __name__ == "__main__": + pass diff --git a/longest-substring-without-repeating-characters/solution.py b/longest-substring-without-repeating-characters/solution.py new file mode 100644 index 0000000..93d86a6 --- /dev/null +++ b/longest-substring-without-repeating-characters/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-substring-without-repeating-characters/ +if __name__ == "__main__": + pass diff --git a/longest-valid-parentheses/solution.py b/longest-valid-parentheses/solution.py new file mode 100644 index 0000000..f0a03ef --- /dev/null +++ b/longest-valid-parentheses/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/longest-valid-parentheses/ +if __name__ == "__main__": + pass diff --git a/lowest-common-ancestor-of-a-binary-tree/solution.py b/lowest-common-ancestor-of-a-binary-tree/solution.py new file mode 100644 index 0000000..392dffe --- /dev/null +++ b/lowest-common-ancestor-of-a-binary-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/ +if __name__ == "__main__": + pass diff --git a/lru-cache/solution.py b/lru-cache/solution.py new file mode 100644 index 0000000..924a151 --- /dev/null +++ b/lru-cache/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/lru-cache/ +if __name__ == "__main__": + pass diff --git a/majority-element/solution.py b/majority-element/solution.py new file mode 100644 index 0000000..2baf953 --- /dev/null +++ b/majority-element/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/majority-element/ +if __name__ == "__main__": + pass diff --git a/maximum-depth-of-binary-tree/solution.py b/maximum-depth-of-binary-tree/solution.py new file mode 100644 index 0000000..291c36a --- /dev/null +++ b/maximum-depth-of-binary-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/maximum-depth-of-binary-tree/ +if __name__ == "__main__": + pass diff --git a/maximum-product-subarray/solution.py b/maximum-product-subarray/solution.py new file mode 100644 index 0000000..a84f482 --- /dev/null +++ b/maximum-product-subarray/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/maximum-product-subarray/ +if __name__ == "__main__": + pass diff --git a/maximum-subarray/solution.py b/maximum-subarray/solution.py new file mode 100644 index 0000000..7984257 --- /dev/null +++ b/maximum-subarray/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/maximum-subarray/ +if __name__ == "__main__": + pass diff --git a/median-of-two-sorted-arrays/solution.py b/median-of-two-sorted-arrays/solution.py new file mode 100644 index 0000000..a4e6bb2 --- /dev/null +++ b/median-of-two-sorted-arrays/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/median-of-two-sorted-arrays/ +if __name__ == "__main__": + pass diff --git a/merge-intervals/solution.py b/merge-intervals/solution.py new file mode 100644 index 0000000..5fb45da --- /dev/null +++ b/merge-intervals/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/merge-intervals/ +if __name__ == "__main__": + pass diff --git a/merge-k-sorted-lists/solution.py b/merge-k-sorted-lists/solution.py new file mode 100644 index 0000000..5610b41 --- /dev/null +++ b/merge-k-sorted-lists/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/merge-k-sorted-lists/ +if __name__ == "__main__": + pass diff --git a/merge-two-sorted-lists/solution.py b/merge-two-sorted-lists/solution.py new file mode 100644 index 0000000..aeb83c6 --- /dev/null +++ b/merge-two-sorted-lists/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/merge-two-sorted-lists/ +if __name__ == "__main__": + pass diff --git a/min-stack/solution.py b/min-stack/solution.py new file mode 100644 index 0000000..c6ea0b0 --- /dev/null +++ b/min-stack/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/min-stack/ +if __name__ == "__main__": + pass diff --git a/minimum-path-sum/solution.py b/minimum-path-sum/solution.py new file mode 100644 index 0000000..4612110 --- /dev/null +++ b/minimum-path-sum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/minimum-path-sum/ +if __name__ == "__main__": + pass diff --git a/minimum-window-substring/solution.py b/minimum-window-substring/solution.py new file mode 100644 index 0000000..a37503e --- /dev/null +++ b/minimum-window-substring/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/minimum-window-substring/ +if __name__ == "__main__": + pass diff --git a/move-zeroes/solution.py b/move-zeroes/solution.py new file mode 100644 index 0000000..aa2fdec --- /dev/null +++ b/move-zeroes/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/move-zeroes/ +if __name__ == "__main__": + pass diff --git a/n-queens/solution.py b/n-queens/solution.py new file mode 100644 index 0000000..06ee252 --- /dev/null +++ b/n-queens/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/n-queens/ +if __name__ == "__main__": + pass diff --git a/next-permutation/solution.py b/next-permutation/solution.py new file mode 100644 index 0000000..73fa3eb --- /dev/null +++ b/next-permutation/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/next-permutation/ +if __name__ == "__main__": + pass diff --git a/number-of-islands/solution.py b/number-of-islands/solution.py new file mode 100644 index 0000000..5bfaf21 --- /dev/null +++ b/number-of-islands/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/number-of-islands/ +if __name__ == "__main__": + pass diff --git a/palindrome-linked-list/solution.py b/palindrome-linked-list/solution.py new file mode 100644 index 0000000..ed587d6 --- /dev/null +++ b/palindrome-linked-list/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/palindrome-linked-list/ +if __name__ == "__main__": + pass diff --git a/palindrome-partitioning/solution.py b/palindrome-partitioning/solution.py new file mode 100644 index 0000000..baa174e --- /dev/null +++ b/palindrome-partitioning/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/palindrome-partitioning/ +if __name__ == "__main__": + pass diff --git a/partition-equal-subset-sum/solution.py b/partition-equal-subset-sum/solution.py new file mode 100644 index 0000000..307ed47 --- /dev/null +++ b/partition-equal-subset-sum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/partition-equal-subset-sum/ +if __name__ == "__main__": + pass diff --git a/partition-labels/solution.py b/partition-labels/solution.py new file mode 100644 index 0000000..e068d9e --- /dev/null +++ b/partition-labels/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/partition-labels/ +if __name__ == "__main__": + pass diff --git a/pascals-triangle/solution.py b/pascals-triangle/solution.py new file mode 100644 index 0000000..e4e8401 --- /dev/null +++ b/pascals-triangle/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/pascals-triangle/ +if __name__ == "__main__": + pass diff --git a/path-sum-iii/solution.py b/path-sum-iii/solution.py new file mode 100644 index 0000000..74aa701 --- /dev/null +++ b/path-sum-iii/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/path-sum-iii/ +if __name__ == "__main__": + pass diff --git a/perfect-squares/solution.py b/perfect-squares/solution.py new file mode 100644 index 0000000..696fa24 --- /dev/null +++ b/perfect-squares/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/perfect-squares/ +if __name__ == "__main__": + pass diff --git a/permutations/solution.py b/permutations/solution.py new file mode 100644 index 0000000..f70e63e --- /dev/null +++ b/permutations/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/permutations/ +if __name__ == "__main__": + pass diff --git a/product-of-array-except-self/solution.py b/product-of-array-except-self/solution.py new file mode 100644 index 0000000..1f846c2 --- /dev/null +++ b/product-of-array-except-self/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/product-of-array-except-self/ +if __name__ == "__main__": + pass diff --git a/remove-nth-node-from-end-of-list/solution.py b/remove-nth-node-from-end-of-list/solution.py new file mode 100644 index 0000000..c742ea5 --- /dev/null +++ b/remove-nth-node-from-end-of-list/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/remove-nth-node-from-end-of-list/ +if __name__ == "__main__": + pass diff --git a/reverse-linked-list/solution.py b/reverse-linked-list/solution.py new file mode 100644 index 0000000..63640a7 --- /dev/null +++ b/reverse-linked-list/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/reverse-linked-list/ +if __name__ == "__main__": + pass diff --git a/reverse-nodes-in-k-group/solution.py b/reverse-nodes-in-k-group/solution.py new file mode 100644 index 0000000..c6e87b5 --- /dev/null +++ b/reverse-nodes-in-k-group/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/reverse-nodes-in-k-group/ +if __name__ == "__main__": + pass diff --git a/rotate-array/solution.py b/rotate-array/solution.py new file mode 100644 index 0000000..25c18d3 --- /dev/null +++ b/rotate-array/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/rotate-array/ +if __name__ == "__main__": + pass diff --git a/rotate-image/solution.py b/rotate-image/solution.py new file mode 100644 index 0000000..da4ebd9 --- /dev/null +++ b/rotate-image/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/rotate-image/ +if __name__ == "__main__": + pass diff --git a/rotting-oranges/solution.py b/rotting-oranges/solution.py new file mode 100644 index 0000000..2367dfe --- /dev/null +++ b/rotting-oranges/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/rotting-oranges/ +if __name__ == "__main__": + pass diff --git a/search-a-2d-matrix-ii/solution.py b/search-a-2d-matrix-ii/solution.py new file mode 100644 index 0000000..071191c --- /dev/null +++ b/search-a-2d-matrix-ii/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/search-a-2d-matrix-ii/ +if __name__ == "__main__": + pass diff --git a/search-a-2d-matrix/solution.py b/search-a-2d-matrix/solution.py new file mode 100644 index 0000000..e50b298 --- /dev/null +++ b/search-a-2d-matrix/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/search-a-2d-matrix/ +if __name__ == "__main__": + pass diff --git a/search-in-rotated-sorted-array/solution.py b/search-in-rotated-sorted-array/solution.py new file mode 100644 index 0000000..4de067e --- /dev/null +++ b/search-in-rotated-sorted-array/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/search-in-rotated-sorted-array/ +if __name__ == "__main__": + pass diff --git a/search-insert-position/solution.py b/search-insert-position/solution.py new file mode 100644 index 0000000..7ac52bf --- /dev/null +++ b/search-insert-position/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/search-insert-position/ +if __name__ == "__main__": + pass diff --git a/set-matrix-zeroes/solution.py b/set-matrix-zeroes/solution.py new file mode 100644 index 0000000..8455de1 --- /dev/null +++ b/set-matrix-zeroes/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/set-matrix-zeroes/ +if __name__ == "__main__": + pass diff --git a/single-number/solution.py b/single-number/solution.py new file mode 100644 index 0000000..e1d235b --- /dev/null +++ b/single-number/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/single-number/ +if __name__ == "__main__": + pass diff --git a/sliding-window-maximum/solution.py b/sliding-window-maximum/solution.py new file mode 100644 index 0000000..88606e2 --- /dev/null +++ b/sliding-window-maximum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/sliding-window-maximum/ +if __name__ == "__main__": + pass diff --git a/sort-colors/solution.py b/sort-colors/solution.py new file mode 100644 index 0000000..6eaff41 --- /dev/null +++ b/sort-colors/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/sort-colors/ +if __name__ == "__main__": + pass diff --git a/sort-list/solution.py b/sort-list/solution.py new file mode 100644 index 0000000..f6da39a --- /dev/null +++ b/sort-list/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/sort-list/ +if __name__ == "__main__": + pass diff --git a/spiral-matrix/solution.py b/spiral-matrix/solution.py new file mode 100644 index 0000000..9e8dc9b --- /dev/null +++ b/spiral-matrix/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/spiral-matrix/ +if __name__ == "__main__": + pass diff --git a/subarray-sum-equals-k/solution.py b/subarray-sum-equals-k/solution.py new file mode 100644 index 0000000..6b3ca63 --- /dev/null +++ b/subarray-sum-equals-k/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/subarray-sum-equals-k/ +if __name__ == "__main__": + pass diff --git a/subsets/solution.py b/subsets/solution.py new file mode 100644 index 0000000..4146a6d --- /dev/null +++ b/subsets/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/subsets/ +if __name__ == "__main__": + pass diff --git a/swap-nodes-in-pairs/solution.py b/swap-nodes-in-pairs/solution.py new file mode 100644 index 0000000..6a7be72 --- /dev/null +++ b/swap-nodes-in-pairs/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/swap-nodes-in-pairs/ +if __name__ == "__main__": + pass diff --git a/symmetric-tree/solution.py b/symmetric-tree/solution.py new file mode 100644 index 0000000..2bb4027 --- /dev/null +++ b/symmetric-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/symmetric-tree/ +if __name__ == "__main__": + pass diff --git a/top-k-frequent-elements/solution.py b/top-k-frequent-elements/solution.py new file mode 100644 index 0000000..00b9fa8 --- /dev/null +++ b/top-k-frequent-elements/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/top-k-frequent-elements/ +if __name__ == "__main__": + pass diff --git a/top.md b/top.md new file mode 100644 index 0000000..21d771c --- /dev/null +++ b/top.md @@ -0,0 +1,100 @@ +- [ ] [两数之和](https://leetcode.cn/problems/two-sum/) +- [ ] [字母异位词分组](https://leetcode.cn/problems/group-anagrams/) +- [ ] [最长连续序列](https://leetcode.cn/problems/longest-consecutive-sequence/) +- [ ] [移动零](https://leetcode.cn/problems/move-zeroes/) +- [ ] [盛最多水的容器](https://leetcode.cn/problems/container-with-most-water/) +- [ ] [三数之和](https://leetcode.cn/problems/3sum/) +- [ ] [接雨水](https://leetcode.cn/problems/trapping-rain-water/) +- [ ] [无重复字符的最长子串](https://leetcode.cn/problems/longest-substring-without-repeating-characters/) +- [ ] [找到字符串中所有字母异位词](https://leetcode.cn/problems/find-all-anagrams-in-a-string/) +- [ ] [和为 K 的子数组](https://leetcode.cn/problems/subarray-sum-equals-k/) +- [ ] [滑动窗口最大值](https://leetcode.cn/problems/sliding-window-maximum/) +- [ ] [最小覆盖子串](https://leetcode.cn/problems/minimum-window-substring/) +- [ ] [最大子数组和](https://leetcode.cn/problems/maximum-subarray/) +- [ ] [合并区间](https://leetcode.cn/problems/merge-intervals/) +- [ ] [轮转数组](https://leetcode.cn/problems/rotate-array/) +- [ ] [除了自身以外数组的乘积](https://leetcode.cn/problems/product-of-array-except-self/) +- [ ] [缺失的第一个正数](https://leetcode.cn/problems/first-missing-positive/) +- [ ] [矩阵置零](https://leetcode.cn/problems/set-matrix-zeroes/) +- [ ] [螺旋矩阵](https://leetcode.cn/problems/spiral-matrix/) +- [ ] [旋转图像](https://leetcode.cn/problems/rotate-image/) +- [ ] [搜索二维矩阵 II](https://leetcode.cn/problems/search-a-2d-matrix-ii/) +- [ ] [相交链表](https://leetcode.cn/problems/intersection-of-two-linked-lists/) +- [ ] [反转链表](https://leetcode.cn/problems/reverse-linked-list/) +- [ ] [回文链表](https://leetcode.cn/problems/palindrome-linked-list/) +- [ ] [环形链表](https://leetcode.cn/problems/linked-list-cycle/) +- [ ] [环形链表 II](https://leetcode.cn/problems/linked-list-cycle-ii/) +- [ ] [合并两个有序链表](https://leetcode.cn/problems/merge-two-sorted-lists/) +- [ ] [两数相加](https://leetcode.cn/problems/add-two-numbers/) +- [ ] [删除链表的倒数第 N 个结点](https://leetcode.cn/problems/remove-nth-node-from-end-of-list/) +- [ ] [两两交换链表中的节点](https://leetcode.cn/problems/swap-nodes-in-pairs/) +- [ ] [K 个一组翻转链表](https://leetcode.cn/problems/reverse-nodes-in-k-group/) +- [ ] [随机链表的复制](https://leetcode.cn/problems/copy-list-with-random-pointer/) +- [ ] [排序链表](https://leetcode.cn/problems/sort-list/) +- [ ] [合并 K 个升序链表](https://leetcode.cn/problems/merge-k-sorted-lists/) +- [ ] [LRU 缓存](https://leetcode.cn/problems/lru-cache/) +- [ ] [二叉树的中序遍历](https://leetcode.cn/problems/binary-tree-inorder-traversal/) +- [ ] [二叉树的最大深度](https://leetcode.cn/problems/maximum-depth-of-binary-tree/) +- [ ] [翻转二叉树](https://leetcode.cn/problems/invert-binary-tree/) +- [ ] [对称二叉树](https://leetcode.cn/problems/symmetric-tree/) +- [ ] [二叉树的直径](https://leetcode.cn/problems/diameter-of-binary-tree/) +- [ ] [二叉树的层序遍历](https://leetcode.cn/problems/binary-tree-level-order-traversal/) +- [ ] [将有序数组转换为二叉搜索树](https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/) +- [ ] [验证二叉搜索树](https://leetcode.cn/problems/validate-binary-search-tree/) +- [ ] [二叉搜索树中第 K 小的元素](https://leetcode.cn/problems/kth-smallest-element-in-a-bst/) +- [ ] [二叉树的右视图](https://leetcode.cn/problems/binary-tree-right-side-view/) +- [ ] [二叉树展开为链表](https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/) +- [ ] [从前序与中序遍历序列构造二叉树](https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) +- [ ] [路径总和 III](https://leetcode.cn/problems/path-sum-iii/) +- [ ] [二叉树的最近公共祖先](https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/) +- [ ] [二叉树中的最大路径和](https://leetcode.cn/problems/binary-tree-maximum-path-sum/) +- [ ] [岛屿数量](https://leetcode.cn/problems/number-of-islands/) +- [ ] [腐烂的橘子](https://leetcode.cn/problems/rotting-oranges/) +- [ ] [课程表](https://leetcode.cn/problems/course-schedule/) +- [ ] [实现 Trie (前缀树)](https://leetcode.cn/problems/implement-trie-prefix-tree/) +- [ ] [全排列](https://leetcode.cn/problems/permutations/) +- [ ] [子集](https://leetcode.cn/problems/subsets/) +- [ ] [电话号码的字母组合](https://leetcode.cn/problems/letter-combinations-of-a-phone-number/) +- [ ] [组合总和](https://leetcode.cn/problems/combination-sum/) +- [ ] [括号生成](https://leetcode.cn/problems/generate-parentheses/) +- [ ] [单词搜索](https://leetcode.cn/problems/word-search/) +- [ ] [分割回文串](https://leetcode.cn/problems/palindrome-partitioning/) +- [ ] [N 皇后](https://leetcode.cn/problems/n-queens/) +- [ ] [搜索插入位置](https://leetcode.cn/problems/search-insert-position/) +- [ ] [搜索二维矩阵](https://leetcode.cn/problems/search-a-2d-matrix/) +- [ ] [在排序数组中查找元素的第一个和最后一个位置](https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/) +- [ ] [搜索旋转排序数组](https://leetcode.cn/problems/search-in-rotated-sorted-array/) +- [ ] [寻找旋转排序数组中的最小值](https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/) +- [ ] [寻找两个正序数组的中位数](https://leetcode.cn/problems/median-of-two-sorted-arrays/) +- [ ] [有效的括号](https://leetcode.cn/problems/valid-parentheses/) +- [ ] [最小栈](https://leetcode.cn/problems/min-stack/) +- [ ] [字符串解码](https://leetcode.cn/problems/decode-string/) +- [ ] [每日温度](https://leetcode.cn/problems/daily-temperatures/) +- [ ] [柱状图中最大的矩形](https://leetcode.cn/problems/largest-rectangle-in-histogram/) +- [ ] [数组中的第K个最大元素](https://leetcode.cn/problems/kth-largest-element-in-an-array/) +- [ ] [前 K 个高频元素](https://leetcode.cn/problems/top-k-frequent-elements/) +- [ ] [数据流的中位数](https://leetcode.cn/problems/find-median-from-data-stream/) +- [ ] [买卖股票的最佳时机](https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/) +- [ ] [跳跃游戏](https://leetcode.cn/problems/jump-game/) +- [ ] [跳跃游戏 II](https://leetcode.cn/problems/jump-game-ii/) +- [ ] [划分字母区间](https://leetcode.cn/problems/partition-labels/) +- [ ] [爬楼梯](https://leetcode.cn/problems/climbing-stairs/) +- [ ] [杨辉三角](https://leetcode.cn/problems/pascals-triangle/) +- [ ] [打家劫舍](https://leetcode.cn/problems/house-robber/) +- [ ] [完全平方数](https://leetcode.cn/problems/perfect-squares/) +- [ ] [零钱兑换](https://leetcode.cn/problems/coin-change/) +- [ ] [单词拆分](https://leetcode.cn/problems/word-break/) +- [ ] [最长递增子序列](https://leetcode.cn/problems/longest-increasing-subsequence/) +- [ ] [乘积最大子数组](https://leetcode.cn/problems/maximum-product-subarray/) +- [ ] [分割等和子集](https://leetcode.cn/problems/partition-equal-subset-sum/) +- [ ] [最长有效括号](https://leetcode.cn/problems/longest-valid-parentheses/) +- [ ] [不同路径](https://leetcode.cn/problems/unique-paths/) +- [ ] [最小路径和](https://leetcode.cn/problems/minimum-path-sum/) +- [ ] [最长回文子串](https://leetcode.cn/problems/longest-palindromic-substring/) +- [ ] [最长公共子序列](https://leetcode.cn/problems/longest-common-subsequence/) +- [ ] [编辑距离](https://leetcode.cn/problems/edit-distance/) +- [ ] [只出现一次的数字](https://leetcode.cn/problems/single-number/) +- [ ] [多数元素](https://leetcode.cn/problems/majority-element/) +- [ ] [颜色分类](https://leetcode.cn/problems/sort-colors/) +- [ ] [下一个排列](https://leetcode.cn/problems/next-permutation/) +- [ ] [寻找重复数](https://leetcode.cn/problems/find-the-duplicate-number/) diff --git a/trapping-rain-water/solution.py b/trapping-rain-water/solution.py new file mode 100644 index 0000000..f166c68 --- /dev/null +++ b/trapping-rain-water/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/trapping-rain-water/ +if __name__ == "__main__": + pass diff --git a/two-sum/solution.py b/two-sum/solution.py new file mode 100644 index 0000000..b454086 --- /dev/null +++ b/two-sum/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/two-sum/ +if __name__ == "__main__": + pass diff --git a/unique-paths/solution.py b/unique-paths/solution.py new file mode 100644 index 0000000..e16acae --- /dev/null +++ b/unique-paths/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/unique-paths/ +if __name__ == "__main__": + pass diff --git a/valid-parentheses/solution.py b/valid-parentheses/solution.py new file mode 100644 index 0000000..71c3173 --- /dev/null +++ b/valid-parentheses/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/valid-parentheses/ +if __name__ == "__main__": + pass diff --git a/validate-binary-search-tree/solution.py b/validate-binary-search-tree/solution.py new file mode 100644 index 0000000..03ed160 --- /dev/null +++ b/validate-binary-search-tree/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/validate-binary-search-tree/ +if __name__ == "__main__": + pass diff --git a/word-break/solution.py b/word-break/solution.py new file mode 100644 index 0000000..fad3079 --- /dev/null +++ b/word-break/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/word-break/ +if __name__ == "__main__": + pass diff --git a/word-search/solution.py b/word-search/solution.py new file mode 100644 index 0000000..aba8f0d --- /dev/null +++ b/word-search/solution.py @@ -0,0 +1,3 @@ +# https://leetcode.cn/problems/word-search/ +if __name__ == "__main__": + pass