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