feat: add 100 leetcode hot100 problem folders with solution scaffolding

This commit is contained in:
2026-04-29 21:26:09 +08:00
parent c39ae0d3e1
commit 8f66731d82
103 changed files with 534 additions and 15 deletions

View File

@@ -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)

37
3sum/solution.py Normal file
View File

@@ -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)

100
README.md Normal file
View File

@@ -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/)

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/add-two-numbers/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/binary-tree-inorder-traversal/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/binary-tree-level-order-traversal/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/binary-tree-maximum-path-sum/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/binary-tree-right-side-view/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/climbing-stairs/
if __name__ == "__main__":
pass

3
coin-change/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/coin-change/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/combination-sum/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/container-with-most-water/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/copy-list-with-random-pointer/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/course-schedule/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/daily-temperatures/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/decode-string/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/diameter-of-binary-tree/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/edit-distance/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/find-all-anagrams-in-a-string/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/find-median-from-data-stream/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/find-the-duplicate-number/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/first-missing-positive/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/generate-parentheses/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/group-anagrams/
if __name__ == "__main__":
pass

3
house-robber/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/house-robber/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/implement-trie-prefix-tree/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/intersection-of-two-linked-lists/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/invert-binary-tree/
if __name__ == "__main__":
pass

3
jump-game-ii/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/jump-game-ii/
if __name__ == "__main__":
pass

3
jump-game/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/jump-game/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/kth-largest-element-in-an-array/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/kth-smallest-element-in-a-bst/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/largest-rectangle-in-histogram/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/letter-combinations-of-a-phone-number/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/linked-list-cycle-ii/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/linked-list-cycle/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-common-subsequence/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-consecutive-sequence/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-increasing-subsequence/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-palindromic-substring/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-substring-without-repeating-characters/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/longest-valid-parentheses/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/
if __name__ == "__main__":
pass

3
lru-cache/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/lru-cache/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/majority-element/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/maximum-depth-of-binary-tree/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/maximum-product-subarray/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/maximum-subarray/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/median-of-two-sorted-arrays/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/merge-intervals/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/merge-k-sorted-lists/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/merge-two-sorted-lists/
if __name__ == "__main__":
pass

3
min-stack/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/min-stack/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/minimum-path-sum/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/minimum-window-substring/
if __name__ == "__main__":
pass

3
move-zeroes/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/move-zeroes/
if __name__ == "__main__":
pass

3
n-queens/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/n-queens/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/next-permutation/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/number-of-islands/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/palindrome-linked-list/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/palindrome-partitioning/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/partition-equal-subset-sum/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/partition-labels/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/pascals-triangle/
if __name__ == "__main__":
pass

3
path-sum-iii/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/path-sum-iii/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/perfect-squares/
if __name__ == "__main__":
pass

3
permutations/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/permutations/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/product-of-array-except-self/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/remove-nth-node-from-end-of-list/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/reverse-linked-list/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/reverse-nodes-in-k-group/
if __name__ == "__main__":
pass

3
rotate-array/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/rotate-array/
if __name__ == "__main__":
pass

3
rotate-image/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/rotate-image/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/rotting-oranges/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/search-a-2d-matrix-ii/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/search-a-2d-matrix/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/search-in-rotated-sorted-array/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/search-insert-position/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/set-matrix-zeroes/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/single-number/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/sliding-window-maximum/
if __name__ == "__main__":
pass

3
sort-colors/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/sort-colors/
if __name__ == "__main__":
pass

3
sort-list/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/sort-list/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/spiral-matrix/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/subarray-sum-equals-k/
if __name__ == "__main__":
pass

3
subsets/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/subsets/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/swap-nodes-in-pairs/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/symmetric-tree/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/top-k-frequent-elements/
if __name__ == "__main__":
pass

100
top.md Normal file
View File

@@ -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/)

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/trapping-rain-water/
if __name__ == "__main__":
pass

3
two-sum/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/two-sum/
if __name__ == "__main__":
pass

3
unique-paths/solution.py Normal file
View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/unique-paths/
if __name__ == "__main__":
pass

View File

@@ -0,0 +1,3 @@
# https://leetcode.cn/problems/valid-parentheses/
if __name__ == "__main__":
pass

Some files were not shown because too many files have changed in this diff Show More