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
/
java
/
Copy path
Directory actions
More options
Directory actions
More options
Latest commit
History
History
master
Breadcrumbs
leetcode
/
java
/
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
1.Two Sum(两数之和).java
1.Two Sum(两数之和).java
10.Regular Expression Matching(正则表达式匹配).java
10.Regular Expression Matching(正则表达式匹配).java
100.Same Tree(相同的树).java
100.Same Tree(相同的树).java
101.Symmetric Tree(对称二叉树).java
101.Symmetric Tree(对称二叉树).java
102.Binary Tree Level Order Traversal(二叉树的层次遍历).java
102.Binary Tree Level Order Traversal(二叉树的层次遍历).java
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).java
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).java
104.Maximum Depth of Binary Tree(二叉树的最大深度).java
104.Maximum Depth of Binary Tree(二叉树的最大深度).java
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).java
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).java
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).java
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).java
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).java
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).java
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).java
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).java
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).java
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).java
11.Container With Most Water(盛最多水的容器).java
11.Container With Most Water(盛最多水的容器).java
110.Balanced Binary Tree(平衡二叉树).java
110.Balanced Binary Tree(平衡二叉树).java
111.Minimum Depth of Binary Tree(二叉树的最小深度).java
111.Minimum Depth of Binary Tree(二叉树的最小深度).java
112.Path Sum(路径总和).java
112.Path Sum(路径总和).java
113.Path Sum II(路径总和 II).java
113.Path Sum II(路径总和 II).java
114.Flatten Binary Tree to Linked List(二叉树展开为链表).java
114.Flatten Binary Tree to Linked List(二叉树展开为链表).java
115.Distinct Subsequences(不同的子序列).java
115.Distinct Subsequences(不同的子序列).java
116.Populating Next Right Pointers in Each Node(填充同一层的兄弟节点).java
116.Populating Next Right Pointers in Each Node(填充同一层的兄弟节点).java
117.Populating Next Right Pointers in Each Node II(填充同一层的兄弟节点 II).java
117.Populating Next Right Pointers in Each Node II(填充同一层的兄弟节点 II).java
118.Pascal's Triangle(杨辉三角).java
118.Pascal's Triangle(杨辉三角).java
119.Pascal's Triangle II(杨辉三角 II).java
119.Pascal's Triangle II(杨辉三角 II).java
12.Integer to Roman(整数转罗马数字).java
12.Integer to Roman(整数转罗马数字).java
120.Triangle(三角形最小路径和).java
120.Triangle(三角形最小路径和).java
121.Best Time to Buy and Sell Stock(买卖股票的最佳时机).java
121.Best Time to Buy and Sell Stock(买卖股票的最佳时机).java
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).java
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).java
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).java
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).java
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).java
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).java
125.Valid Palindrome(验证回文串).java
125.Valid Palindrome(验证回文串).java
126.Word Ladder II(单词接龙 II).java
126.Word Ladder II(单词接龙 II).java
127.Word Ladder(单词接龙).java
127.Word Ladder(单词接龙).java
128.Longest Consecutive Sequence(最长连续序列).java
128.Longest Consecutive Sequence(最长连续序列).java
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).java
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).java
13.Roman to Integer(罗马数字转整数).java
13.Roman to Integer(罗马数字转整数).java
130.Surrounded Regions(被围绕的区域).java
130.Surrounded Regions(被围绕的区域).java
131.Palindrome Partitioning(分割回文串).java
131.Palindrome Partitioning(分割回文串).java
132.Palindrome Partitioning II(分割回文串 II).java
132.Palindrome Partitioning II(分割回文串 II).java
133.Clone Graph(克隆图).java
133.Clone Graph(克隆图).java
134.Gas Station(加油站).java
134.Gas Station(加油站).java
135.Candy(分发糖果).java
135.Candy(分发糖果).java
136.Single Number(只出现一次的数字).java
136.Single Number(只出现一次的数字).java
137.Single Number II(只出现一次的数字 II).java
137.Single Number II(只出现一次的数字 II).java
138.Copy List with Random Pointer(复制带随机指针的链表).java
138.Copy List with Random Pointer(复制带随机指针的链表).java
139.Word Break(单词拆分).java
139.Word Break(单词拆分).java
14.Longest Common Prefix(最长公共前缀).java
14.Longest Common Prefix(最长公共前缀).java
140.Word Break II(单词拆分 II).java
140.Word Break II(单词拆分 II).java
141.Linked List Cycle(环形链表).java
141.Linked List Cycle(环形链表).java
142.Linked List Cycle II(环形链表 II).java
142.Linked List Cycle II(环形链表 II).java
143.Reorder List(重排链表).java
143.Reorder List(重排链表).java
144.Binary Tree Preorder Traversal(二叉树的前序遍历).java
144.Binary Tree Preorder Traversal(二叉树的前序遍历).java
145.Binary Tree Postorder Traversal(二叉树的后序遍历).java
145.Binary Tree Postorder Traversal(二叉树的后序遍历).java
146.LRU Cache(LRU缓存机制).java
146.LRU Cache(LRU缓存机制).java
147.Insertion Sort List(对链表进行插入排序).java
147.Insertion Sort List(对链表进行插入排序).java
148.Sort List(排序链表).java
148.Sort List(排序链表).java
149.Max Points on a Line(直线上最多的点数).java
149.Max Points on a Line(直线上最多的点数).java
15.3Sum(三数之和).java
15.3Sum(三数之和).java
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).java
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).java
151.Reverse Words in a String(翻转字符串里的单词).java
151.Reverse Words in a String(翻转字符串里的单词).java
152.Maximum Product Subarray(乘积最大子序列).java
152.Maximum Product Subarray(乘积最大子序列).java
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).java
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).java
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).java
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).java
155.Min Stack(最小栈).java
155.Min Stack(最小栈).java
16.3Sum Closest(最接近的三数之和).java
16.3Sum Closest(最接近的三数之和).java
160.Intersection of Two Linked Lists(相交链表).java
160.Intersection of Two Linked Lists(相交链表).java
162.Find Peak Element(寻找峰值).java
162.Find Peak Element(寻找峰值).java
164.Maximum Gap(最大间距).java
164.Maximum Gap(最大间距).java
165.Compare Version Numbers(比较版本号).java
165.Compare Version Numbers(比较版本号).java
166.Fraction to Recurring Decimal(分数到小数).java
166.Fraction to Recurring Decimal(分数到小数).java
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).java
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).java
168.Excel Sheet Column Title(Excel表列名称).java
168.Excel Sheet Column Title(Excel表列名称).java
169.Majority Element(求众数).java
169.Majority Element(求众数).java
17.Letter Combinations of a Phone Number(电话号码的字母组合).java
17.Letter Combinations of a Phone Number(电话号码的字母组合).java
171.Excel Sheet Column Number(Excel表列序号).java
171.Excel Sheet Column Number(Excel表列序号).java
172.Factorial Trailing Zeroes(阶乘后的零).java
172.Factorial Trailing Zeroes(阶乘后的零).java
173.Binary Search Tree Iterator(二叉搜索树迭代器).java
173.Binary Search Tree Iterator(二叉搜索树迭代器).java
174.Dungeon Game(地下城游戏).java
174.Dungeon Game(地下城游戏).java
179.Largest Number(最大数).java
179.Largest Number(最大数).java
18.4Sum(四数之和).java
18.4Sum(四数之和).java
187.Repeated DNA Sequences(重复的DNA序列).java
187.Repeated DNA Sequences(重复的DNA序列).java
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时机 IV).java
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时��� IV).java
189.Rotate Array(旋转数组).java
189.Rotate Array(旋转数组).java
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).java
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).java
190.Reverse Bits(颠倒二进制位).java
190.Reverse Bits(颠倒二进制位).java
191.Number of 1 Bits(位1的个数).java
191.Number of 1 Bits(位1的个数).java
198.House Robber(打家劫舍).java
198.House Robber(打家劫舍).java
199.Binary Tree Right Side View(二叉树的右视图).java
199.Binary Tree Right Side View(二叉树的右视图).java
2.Add Two Numbers(两数相加).java
2.Add Two Numbers(两数相加).java
20.Valid Parentheses(有效的括号).java
20.Valid Parentheses(有效的括号).java
200.Number of Islands(岛屿的个数).java
200.Number of Islands(岛屿的个数).java
201.Bitwise AND of Numbers Range(数字范围按位与).java
201.Bitwise AND of Numbers Range(数字范围按位与).java
202.Happy Number(快乐数).java
202.Happy Number(快乐数).java
203.Remove Linked List Elements(删除链表中的节点).java
203.Remove Linked List Elements(删除链表中的节点).java
204.Count Primes(计数质数).java
204.Count Primes(计数质数).java
205.Isomorphic Strings(同构字符串).java
205.Isomorphic Strings(同构字符串).java
206.Reverse Linked List(反转链表).java
206.Reverse Linked List(反转链表).java
207.Course Schedule(课程表).java
207.Course Schedule(课程表).java
208.Implement Trie (Prefix Tree)(实现 Trie (前缀树)).java
208.Implement Trie (Prefix Tree)(实现 Trie (前缀树)).java
209.Minimum Size Subarray Sum(长度最小的子数组).java
209.Minimum Size Subarray Sum(长度最小的子数组).java
21.Merge Two Sorted Lists(合并两个有序链表).java
21.Merge Two Sorted Lists(合并两个有序链表).java
View all files
You can’t perform that action at this time.