Skip to content
Navigation Menu
Toggle navigation
Sign in
Product
GitHub Copilot
Write better code with AI
GitHub Advanced Security
Find and fix vulnerabilities
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Discussions
Collaborate outside of code
Code Search
Find more, search less
Explore
Why GitHub
All features
Documentation
GitHub Skills
Blog
Solutions
By company size
Enterprises
Small and medium teams
Startups
Nonprofits
By use case
DevSecOps
DevOps
CI/CD
View all use cases
By industry
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
Topics
AI
DevOps
Security
Software Development
View all
Explore
Learning Pathways
Events & Webinars
Ebooks & Whitepapers
Customer Stories
Partners
Executive Insights
Open Source
GitHub Sponsors
Fund open source developers
The ReadME Project
GitHub community articles
Repositories
Topics
Trending
Collections
Enterprise
Enterprise platform
AI-powered developer platform
Available add-ons
GitHub Advanced Security
Enterprise-grade security features
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search or jump to...
Search code, repositories, users, issues, pull requests...
Search syntax tips
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign in
Sign up
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
learningtheory
/
leetcode
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Files
master
Breadcrumbs
leetcode
/
python
/
Copy path
Directory actions
More options
Directory actions
More options
Latest commit
History
History
master
Breadcrumbs
leetcode
/
python
/
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
1.Two Sum(两数之和).py
1.Two Sum(两数之和).py
10.Regular Expression Matching(正则表达式匹配).py
10.Regular Expression Matching(正则表达式匹配).py
100.Same Tree(相同的树).py
100.Same Tree(相同的树).py
101.Symmetric Tree(对称二叉树).py
101.Symmetric Tree(对称二叉树).py
102.Binary Tree Level Order Traversal(二叉树的层次遍历).py
102.Binary Tree Level Order Traversal(二叉树的层次遍历).py
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).py
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).py
104.Maximum Depth of Binary Tree(二叉树的最大深度).py
104.Maximum Depth of Binary Tree(二叉树的最大深度).py
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).py
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).py
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).py
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).py
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).py
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).py
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).py
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).py
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).py
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).py
11.Container With Most Water(盛最多水的容器).py
11.Container With Most Water(盛最多水的容器).py
110.Balanced Binary Tree(平衡二叉树).py
110.Balanced Binary Tree(平衡二叉树).py
111.Minimum Depth of Binary Tree(二叉树的最小深度).py
111.Minimum Depth of Binary Tree(二叉树的最小深度).py
112.Path Sum(路径总和).py
112.Path Sum(路径总和).py
113.Path Sum II(路径总和 II).py
113.Path Sum II(路径总和 II).py
114.Flatten Binary Tree to Linked List(二叉树展开为链表).py
114.Flatten Binary Tree to Linked List(二叉树展开为链表).py
115.Distinct Subsequences(不同的子序列).py
115.Distinct Subsequences(不同的子序列).py
116.Populating Next Right Pointers in Each Node(填充同一层的兄弟节点).py
116.Populating Next Right Pointers in Each Node(填充同一层的兄弟节点).py
117.Populating Next Right Pointers in Each Node II(填充同一层的兄弟节点 II).py
117.Populating Next Right Pointers in Each Node II(填充同一层的兄弟节点 II).py
118.Pascal's Triangle(杨辉三角).py
118.Pascal's Triangle(杨辉三角).py
119.Pascal's Triangle II(杨辉三角 II).py
119.Pascal's Triangle II(杨辉三角 II).py
12.Integer to Roman(整数转罗马数字).py
12.Integer to Roman(整数转罗马数字).py
120.Triangle(三角形最小路径和).py
120.Triangle(三角形最小路径和).py
121.Best Time to Buy and Sell Stock(买卖股票的��佳时机).py
121.Best Time to Buy and Sell Stock(买卖股票的最佳时机).py
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).py
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).py
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).py
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).py
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).py
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).py
125.Valid Palindrome(验证回文串).py
125.Valid Palindrome(验证回文串).py
126.Word Ladder II(单词接龙 II).py
126.Word Ladder II(单词接龙 II).py
127.Word Ladder(单词接龙).py
127.Word Ladder(单词接龙).py
128.Longest Consecutive Sequence(最长连续序列).py
128.Longest Consecutive Sequence(最长连续序列).py
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).py
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).py
13.Roman to Integer(罗马数字转整数).py
13.Roman to Integer(罗马数字转整数).py
130.Surrounded Regions(被围绕的区域).py
130.Surrounded Regions(被围绕的区域).py
131.Palindrome Partitioning(分割回文串).py
131.Palindrome Partitioning(分割回文串).py
132.Palindrome Partitioning II(分割回文串 II).py
132.Palindrome Partitioning II(分割回文串 II).py
133.Clone Graph(克隆图).py
133.Clone Graph(克隆图).py
134.Gas Station(加油站).py
134.Gas Station(加油站).py
135.Candy(分发糖果).py
135.Candy(分发糖果).py
136.Single Number(只出现一次的数字).py
136.Single Number(只出现一次的数字).py
137.Single Number II(只出现一次的数字 II).py
137.Single Number II(只出现一次的数字 II).py
138.Copy List with Random Pointer(复制带随机指针的链表).py
138.Copy List with Random Pointer(复制带随机指针的链表).py
139.Word Break(单词拆分).py
139.Word Break(单词拆分).py
14.Longest Common Prefix(最长公共前缀).py
14.Longest Common Prefix(最长公共前缀).py
140.Word Break II(单词拆分 II).py
140.Word Break II(单词拆分 II).py
141.Linked List Cycle(环形链表).py
141.Linked List Cycle(环形链表).py
142.Linked List Cycle II(环形链表 II).py
142.Linked List Cycle II(环形链表 II).py
143.Reorder List(重排链表).py
143.Reorder List(重排链表).py
144.Binary Tree Preorder Traversal(二叉树的前序遍历).py
144.Binary Tree Preorder Traversal(二叉树的前序遍历).py
145.Binary Tree Postorder Traversal(二叉树的后序遍历).py
145.Binary Tree Postorder Traversal(二叉树的后序遍历).py
146.LRU Cache(LRU缓存机制).py
146.LRU Cache(LRU缓存机制).py
147.Insertion Sort List(对链表进行插入排序).py
147.Insertion Sort List(对链表进行插入排序).py
148.Sort List(排序链表).py
148.Sort List(排序链表).py
149.Max Points on a Line(直线上最多的点数).py
149.Max Points on a Line(直线上最多的点数).py
15.3Sum(三数之和).py
15.3Sum(三数之和).py
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).py
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).py
151.Reverse Words in a String(翻转字符串里的单词).py
151.Reverse Words in a String(翻转字符串里的单词).py
152.Maximum Product Subarray(乘积最大子序列).py
152.Maximum Product Subarray(乘积最大子序列).py
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).py
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).py
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).py
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).py
155.Min Stack(最小栈).py
155.Min Stack(最小栈).py
16.3Sum Closest(最接近的三数之和).py
16.3Sum Closest(最接近的三数之和).py
160.Intersection of Two Linked Lists(相交链表).py
160.Intersection of Two Linked Lists(相交链表).py
162.Find Peak Element(寻找峰值).py
162.Find Peak Element(寻找峰值).py
164.Maximum Gap(最大间距).py
164.Maximum Gap(最大间距).py
165.Compare Version Numbers(比较版本号).py
165.Compare Version Numbers(比较版本号).py
166.Fraction to Recurring Decimal(分数到小数).py
166.Fraction to Recurring Decimal(分数到小数).py
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).py
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).py
168.Excel Sheet Column Title(Excel表列名称).py
168.Excel Sheet Column Title(Excel表列名称).py
169.Majority Element(求众数).py
169.Majority Element(求众数).py
17.Letter Combinations of a Phone Number(电话号码的字母组合).py
17.Letter Combinations of a Phone Number(电话号码的字母组合).py
171.Excel Sheet Column Number(Excel表列序号).py
171.Excel Sheet Column Number(Excel表列序号).py
172.Factorial Trailing Zeroes(阶乘后的零).py
172.Factorial Trailing Zeroes(阶乘后的零).py
173.Binary Search Tree Iterator(二叉搜索树迭代器).py
173.Binary Search Tree Iterator(二叉搜索树迭代器).py
174.Dungeon Game(地下城游戏).py
174.Dungeon Game(地下城游戏).py
179.Largest Number(最大数).py
179.Largest Number(最大数).py
18.4Sum(四数之和).py
18.4Sum(四数之和).py
187.Repeated DNA Sequences(重复的DNA序列).py
187.Repeated DNA Sequences(重复的DNA序列).py
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时机 IV).py
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时机 IV).py
189.Rotate Array(旋转数组).py
189.Rotate Array(旋转数组).py
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).py
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).py
190.Reverse Bits(颠倒二进制位).py
190.Reverse Bits(颠倒二进制位).py
191.Number of 1 Bits(位1的个数).py
191.Number of 1 Bits(位1的个数).py
198.House Robber(打家劫舍).py
198.House Robber(打家劫舍).py
199.Binary Tree Right Side View(二叉树的右视图).py
199.Binary Tree Right Side View(二叉树的右视图).py
2.Add Two Numbers(两数相加).py
2.Add Two Numbers(两数相加).py
20.Valid Parentheses(有效的括号).py
20.Valid Parentheses(有效的括号).py
200.Number of Islands(岛屿的个数).py
200.Number of Islands(岛屿的个数).py
201.Bitwise AND of Numbers Range(数字范围按位与).py
201.Bitwise AND of Numbers Range(数字范围按位与).py
202.Happy Number(快乐数).py
202.Happy Number(快乐数).py
203.Remove Linked List Elements(删除链表中的节点).py
203.Remove Linked List Elements(删除链表中的节点).py
204.Count Primes(计数质数).py
204.Count Primes(计数质数).py
205.Isomorphic Strings(同构字符串).py
205.Isomorphic Strings(同构字符串).py
206.Reverse Linked List(反转链表).py
206.Reverse Linked List(反转链表).py
207.Course Schedule(课程表).py
207.Course Schedule(课程表).py
208.Implement Trie (Prefix Tree)(实现 Trie (前缀树)).py
208.Implement Trie (Prefix Tree)(实现 Trie (前缀树)).py
209.Minimum Size Subarray Sum(长度最小的子数组).py
209.Minimum Size Subarray Sum(长度最小的子数组).py
21.Merge Two Sorted Lists(合并两个有序链表).py
21.Merge Two Sorted Lists(合并两个有序链表).py
View all files
You can’t perform that action at this time.