Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
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
/
Sign in
Sign up
Appearance settings
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 }}
vNKB7
leetcode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
leetcode
/
python
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
leetcode
/
python
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
.idea
.idea
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.py
107_Binary_Tree_Level_Order_Traversal_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
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.py
113_Path_Sum_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.py
117_Populating_Next_Right_Pointers_in_Each_Node_II.py
118_Pascal's_Triangle.py
118_Pascal's_Triangle.py
119_Pascal's_Triangle_II.py
119_Pascal's_Triangle_II.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.py
122_Best_Time_to_Buy_and_Sell_Stock_II.py
123_Best_Time_to_Buy_and_Sell_Stock_III.py
123_Best_Time_to_Buy_and_Sell_Stock_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.py
126_Word_Ladder_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
130_Surrounded_Regions.py
130_Surrounded_Regions.py
131_Palindrome_Partitioning.py
131_Palindrome_Partitioning.py
132_Palindrome_Partitioning_II.py
132_Palindrome_Partitioning_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.py
137_Single_Number_II.py
138_Copy_List_with_Random_Pointer.py
138_Copy_List_with_Random_Pointer.py
139_Word_Break.py
139_Word_Break.py
140_Word_Break_II.py
140_Word_Break_II.py
141_Linked_List_Cycle.py
141_Linked_List_Cycle.py
142_Linked_List_Cycle_II.py
142_Linked_List_Cycle_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.py
146_LRU_Cache.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
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
155_Min_Stack.py
155_Min_Stack.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.py
167_Two Sum II - Input array is sorted.py
168_Excel Sheet Column Title.py
168_Excel Sheet Column Title.py
169_Majority Element.py
169_Majority Element.py
171_Excel Sheet Column Number.py
171_Excel Sheet Column Number.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
187_Repeated DNA Sequences.py
187_Repeated DNA Sequences.py
188_Best Time to Buy and Sell Stock IV.py
188_Best Time to Buy and Sell Stock IV.py
189_Rotate Array.py
189_Rotate Array.py
190_Reverse Bits.py
190_Reverse Bits.py
191_Number of 1 Bits.py
191_Number of 1 Bits.py
198_House Robber.py
198_House Robber.py
199_Binary Tree Right Side View.py
199_Binary Tree Right Side View.py
1_Two_Sum.py
1_Two_Sum.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).py
208_Implement Trie (Prefix Tree).py
209_Minimum Size Subarray Sum.py
209_Minimum Size Subarray Sum.py
210_Course Schedule II.py
210_Course Schedule II.py
211_Add and Search Word - Data structure design.py
211_Add and Search Word - Data structure design.py
212_Word Search II.py
212_Word Search II.py
213_House Robber II.py
213_House Robber II.py
214_Shortest Palindrome.py
214_Shortest Palindrome.py
215_Kth Largest Element in an Array.py
215_Kth Largest Element in an Array.py
216_Combination Sum III.py
216_Combination Sum III.py
217_Contains Duplicate.py
217_Contains Duplicate.py
218_The Skyline Problem.py
218_The Skyline Problem.py
219_Contains Duplicate II.py
219_Contains Duplicate II.py
220_Contains Duplicate III.py
220_Contains Duplicate III.py
221_Maximal Square.py
221_Maximal Square.py
222_Count Complete Tree Nodes.py
222_Count Complete Tree Nodes.py
223_Rectangle Area.py
223_Rectangle Area.py
View all files
You can’t perform that action at this time.