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
/
swift
/
Copy path
Directory actions
More options
Directory actions
More options
Latest commit
History
History
master
Breadcrumbs
leetcode
/
swift
/
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
1.Two Sum(两数之和).swift
1.Two Sum(两数之和).swift
10.Regular Expression Matching(正则表达式匹配).swift
10.Regular Expression Matching(正则表达式匹配).swift
100.Same Tree(相同的树).swift
100.Same Tree(相同的树).swift
101.Symmetric Tree(对称二叉树).swift
101.Symmetric Tree(对称二叉树).swift
102.Binary Tree Level Order Traversal(二叉树的层次遍历).swift
102.Binary Tree Level Order Traversal(二叉树的层次遍历).swift
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).swift
103.Binary Tree Zigzag Level Order Traversal(二叉树的锯齿形层次遍历).swift
104.Maximum Depth of Binary Tree(二叉树的最大深度).swift
104.Maximum Depth of Binary Tree(二叉树的最大深度).swift
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).swift
105.Construct Binary Tree from Preorder and Inorder Traversal(从前序与中序遍历序列构造二叉树).swift
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).swift
106.Construct Binary Tree from Inorder and Postorder Traversal(从中序与后序遍历序列构造二叉树).swift
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).swift
107.Binary Tree Level Order Traversal II(二叉树的层次遍历 II).swift
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).swift
108.Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树).swift
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).swift
109.Convert Sorted List to Binary Search Tree(有序链表转换二叉搜索树).swift
11.Container With Most Water(盛最多水的容器).swift
11.Container With Most Water(盛最多水的容器).swift
110.Balanced Binary Tree(平衡二叉树).swift
110.Balanced Binary Tree(平衡二叉树).swift
111.Minimum Depth of Binary Tree(二叉树的最小深度).swift
111.Minimum Depth of Binary Tree(二叉树的最小深度).swift
112.Path Sum(路径总和).swift
112.Path Sum(路径总和).swift
113.Path Sum II(路径总和 II).swift
113.Path Sum II(路径总和 II).swift
114.Flatten Binary Tree to Linked List(二叉树展开为链表).swift
114.Flatten Binary Tree to Linked List(二叉树展开为链表).swift
115.Distinct Subsequences(不同的子序列).swift
115.Distinct Subsequences(不同的子序列).swift
118.Pascal's Triangle(杨辉三角).swift
118.Pascal's Triangle(杨辉三角).swift
119.Pascal's Triangle II(杨辉三角 II).swift
119.Pascal's Triangle II(杨辉三角 II).swift
12.Integer to Roman(整数转罗马数字).swift
12.Integer to Roman(整数转罗马数字).swift
120.Triangle(三角形最小路径和).swift
120.Triangle(三角形最小路径和).swift
121.Best Time to Buy and Sell Stock(买卖股票的最佳时机).swift
121.Best Time to Buy and Sell Stock(买卖股票的最佳时机).swift
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).swift
122.Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II).swift
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).swift
123.Best Time to Buy and Sell Stock III(买卖股票的最佳时机 III).swift
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).swift
124.Binary Tree Maximum Path Sum(二叉树中的最大路径和).swift
125.Valid Palindrome(验证回文串).swift
125.Valid Palindrome(验证回文串).swift
126.Word Ladder II(单词接龙 II).swift
126.Word Ladder II(单词接龙 II).swift
127.Word Ladder(单词接龙).swift
127.Word Ladder(单词接龙).swift
128.Longest Consecutive Sequence(最长连续序列).swift
128.Longest Consecutive Sequence(最长连续序列).swift
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).swift
129.Sum Root to Leaf Numbers(求根到叶子节点数字之和).swift
13.Roman to Integer(罗马数字转整数).swift
13.Roman to Integer(罗马数字转整数).swift
130.Surrounded Regions(被围绕的区域).swift
130.Surrounded Regions(被围绕的区域).swift
131.Palindrome Partitioning(分割回文串).swift
131.Palindrome Partitioning(分割回文串).swift
132.Palindrome Partitioning II(分割回文串 II).swift
132.Palindrome Partitioning II(分割回文串 II).swift
134.Gas Station(加油站).swift
134.Gas Station(加油站).swift
135.Candy(分发糖果).swift
135.Candy(分发糖果).swift
136.Single Number(只出现一次的数字).swift
136.Single Number(只出现一次的数字).swift
137.Single Number II(只出现一次的数字 II).swift
137.Single Number II(只出现一次的数字 II).swift
139.Word Break(单词拆分).swift
139.Word Break(单词拆分).swift
14.Longest Common Prefix(最长公共前缀).swift
14.Longest Common Prefix(最长公共前缀).swift
140.Word Break II(单词拆分 II).swift
140.Word Break II(单词拆分 II).swift
143.Reorder List(重排链表).swift
143.Reorder List(重排链表).swift
144.Binary Tree Preorder Traversal(二叉树的前序遍历).swift
144.Binary Tree Preorder Traversal(二叉树的前序遍历).swift
145.Binary Tree Postorder Traversal(二叉树的后序遍历).swift
145.Binary Tree Postorder Traversal(二叉树的后序遍历).swift
147.Insertion Sort List(对链表进行插入排序).swift
147.Insertion Sort List(对链表进行插入排序).swift
148.Sort List(排序链表).swift
148.Sort List(排序链表).swift
15.3Sum(三数之和).swift
15.3Sum(三数之和).swift
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).swift
150.Evaluate Reverse Polish Notation(逆波兰表达式求值).swift
152.Maximum Product Subarray(乘积最大子序列).swift
152.Maximum Product Subarray(乘积最大子序列).swift
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).swift
153.Find Minimum in Rotated Sorted Array(寻找旋转排序数组中的最小值).swift
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).swift
154.Find Minimum in Rotated Sorted Array II(寻找旋转排序数组中的最小值 II).swift
16.3Sum Closest(最接近的三数之和).swift
16.3Sum Closest(最接近的三数之和).swift
162.Find Peak Element(寻找峰值).swift
162.Find Peak Element(寻找峰值).swift
164.Maximum Gap(最大间距).swift
164.Maximum Gap(最大间距).swift
165.Compare Version Numbers(比较版本号).swift
165.Compare Version Numbers(比较版本号).swift
166.Fraction to Recurring Decimal(分数到小数).swift
166.Fraction to Recurring Decimal(分数到小数).swift
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).swift
167.Two Sum II - Input array is sorted(两数之和 II - 输入有序数组).swift
168.Excel Sheet Column Title(Excel表列名称).swift
168.Excel Sheet Column Title(Excel表列名称).swift
169.Majority Element(求众数).swift
169.Majority Element(求众数).swift
17.Letter Combinations of a Phone Number(电话号码的字母组合).swift
17.Letter Combinations of a Phone Number(电话号码的字母组合).swift
171.Excel Sheet Column Number(Excel表列序号).swift
171.Excel Sheet Column Number(Excel表列序号).swift
172.Factorial Trailing Zeroes(阶乘后的零).swift
172.Factorial Trailing Zeroes(阶乘后的零).swift
174.Dungeon Game(地下城游戏).swift
174.Dungeon Game(地下城游戏).swift
179.Largest Number(最大数).swift
179.Largest Number(最大数).swift
18.4Sum(四数之和).swift
18.4Sum(四数之和).swift
187.Repeated DNA Sequences(重复的DNA序列).swift
187.Repeated DNA Sequences(重复的DNA序列).swift
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时机 IV).swift
188.Best Time to Buy and Sell Stock IV(买卖股票的最佳时机 IV).swift
189.Rotate Array(旋转数组).swift
189.Rotate Array(旋转数组).swift
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).swift
19.Remove Nth Node From End of List(删除链表的倒数第N个节点).swift
198.House Robber(打家劫舍).swift
198.House Robber(打家劫舍).swift
199.Binary Tree Right Side View(二叉树的右视图).swift
199.Binary Tree Right Side View(二叉树的右视图).swift
2.Add Two Numbers(两数相加).swift
2.Add Two Numbers(两数相加).swift
20.Valid Parentheses(有效的括号).swift
20.Valid Parentheses(有效的括号).swift
200.Number of Islands(岛屿的个数).swift
200.Number of Islands(岛屿的个数).swift
202.Happy Number(快乐数).swift
202.Happy Number(快乐数).swift
203.Remove Linked List Elements(删除链表中的节点).swift
203.Remove Linked List Elements(删除链表中的节点).swift
204.Count Primes(计数质数).swift
204.Count Primes(计数质数).swift
205.Isomorphic Strings(同构字符串).swift
205.Isomorphic Strings(同构字符串).swift
206.Reverse Linked List(反转链表).swift
206.Reverse Linked List(反转链表).swift
207.Course Schedule(课程表).swift
207.Course Schedule(课程表).swift
209.Minimum Size Subarray Sum(长度最小的子数组).swift
209.Minimum Size Subarray Sum(长度最小的子数组).swift
21.Merge Two Sorted Lists(合并两个有序链表).swift
21.Merge Two Sorted Lists(合并两个有序链表).swift
210.Course Schedule II(课程表 II).swift
210.Course Schedule II(课程表 II).swift
212.Word Search II(单词搜索 II).swift
212.Word Search II(单词搜索 II).swift
213.House Robber II(打家劫舍 II).swift
213.House Robber II(打家劫舍 II).swift
214.Shortest Palindrome(最短回文串).swift
214.Shortest Palindrome(最短回文串).swift
215.Kth Largest Element in an Array(数组中的第K个最大元素).swift
215.Kth Largest Element in an Array(数组中的第K个最大元素).swift
216.Combination Sum III(组合总和 III).swift
216.Combination Sum III(组合总和 III).swift
217.Contains Duplicate(存在重复元素).swift
217.Contains Duplicate(存在重复元素).swift
218.The Skyline Problem(天际线问题).swift
218.The Skyline Problem(天际线问题).swift
219.Contains Duplicate II(存在重复元素 II).swift
219.Contains Duplicate II(存在重复元素 II).swift
22.Generate Parentheses(括号生成).swift
22.Generate Parentheses(括号生成).swift
220.Contains Duplicate III(存在重复元素 III).swift
220.Contains Duplicate III(存在重复元素 III).swift
221.Maximal Square(最大正方形).swift
221.Maximal Square(最大正方形).swift
222.Count Complete Tree Nodes(完全二叉树的节点个数).swift
222.Count Complete Tree Nodes(完全二叉树的节点个数).swift
223.Rectangle Area(矩形面积).swift
223.Rectangle Area(矩形面积).swift
224.Basic Calculator(基本计算器).swift
224.Basic Calculator(基本计算器).swift
226.Invert Binary Tree(翻转二叉树).swift
226.Invert Binary Tree(翻转二叉树).swift
View all files
You can’t perform that action at this time.