Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
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 }}
sk-g
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
..
1. Two Sum.py
1. Two Sum.py
102. Binary Tree Level Order Traversal.py
102. Binary Tree Level Order Traversal.py
108. Convert Sorted Array to Binary Search Tree.py
108. Convert Sorted Array to Binary Search Tree.py
11. Container With Most Water.py
11. Container With Most Water.py
128.longest-consecutive-sequence.py
128.longest-consecutive-sequence.py
14. Longest Common Prefix.py
14. Longest Common Prefix.py
146. LRU Cache.py
146. LRU Cache.py
15. 3Sum.py
15. 3Sum.py
1520.maximum-number-of-non-overlapping-substrings.py
1520.maximum-number-of-non-overlapping-substrings.py
155.min-stack.py
155.min-stack.py
165. Compare Version Numbers.py
165. Compare Version Numbers.py
167.two-sum-ii-input-array-is-sorted.py
167.two-sum-ii-input-array-is-sorted.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
19. Remove Nth Node From End of List.py
19. Remove Nth Node From End of List.py
191. Number of 1 Bits.py
191. Number of 1 Bits.py
198. House Robber.py
198. House Robber.py
2. Add Two Numbers.py
2. Add Two Numbers.py
20. Valid Parentheses.py
20. Valid Parentheses.py
209. Minimum Size Subarray Sum.py
209. Minimum Size Subarray Sum.py
215. Kth Largest Element in an Array.py
215. Kth Largest Element in an Array.py
215.kth-largest-element-in-an-array.py
215.kth-largest-element-in-an-array.py
219. Contains Duplicate II.py
219. Contains Duplicate II.py
229. Majority Element II.py
229. Majority Element II.py
23.merge-k-sorted-lists.py
23.merge-k-sorted-lists.py
239. Sliding Window Maximum.py
239. Sliding Window Maximum.py
240. Search a 2D Matrix II.py
240. Search a 2D Matrix II.py
253. Meeting Rooms II.py
253. Meeting Rooms II.py
26. Remove Duplicates from Sorted Array.py
26. Remove Duplicates from Sorted Array.py
261. Graph Valid Tree.py
261. Graph Valid Tree.py
27. Remove Element.py
27. Remove Element.py
283. Move Zeroes.py
283. Move Zeroes.py
285. Inorder Successor in BST.py
285. Inorder Successor in BST.py
297.serialize-and-deserialize-binary-tree.py
297.serialize-and-deserialize-binary-tree.py
315.count-of-smaller-numbers-after-self.py
315.count-of-smaller-numbers-after-self.py
318. Maximum Product of Word Lengths.py
318. Maximum Product of Word Lengths.py
33. Search in Rotated Sorted Array.py
33. Search in Rotated Sorted Array.py
330.patching-array.py
330.patching-array.py
344. Reverse String.py
344. Reverse String.py
373. Find K Pairs with Smallest Sums.py
373. Find K Pairs with Smallest Sums.py
388. Longest Absolute File Path.py
388. Longest Absolute File Path.py
4. Median of Two Sorted Arrays.py
4. Median of Two Sorted Arrays.py
415. Add Strings.py
415. Add Strings.py
443. String Compression.py
443. String Compression.py
461. Hamming Distance.py
461. Hamming Distance.py
482. License Key Formatting.py
482. License Key Formatting.py
485. Max Consecutive Ones.py
485. Max Consecutive Ones.py
5.longest-palindromic-substring.py
5.longest-palindromic-substring.py
508.most-frequent-subtree-sum.py
508.most-frequent-subtree-sum.py
518.coin-change-2.py
518.coin-change-2.py
530. Minimum Absolute Difference in BST.py
530. Minimum Absolute Difference in BST.py
532.k-diff-pairs-in-an-array.py
532.k-diff-pairs-in-an-array.py
54. Spiral Matrix.py
54. Spiral Matrix.py
547.number-of-provinces.py
547.number-of-provinces.py
556. Next Greater Element III.py
556. Next Greater Element III.py
557. Reverse Words in a String III.py
557. Reverse Words in a String III.py
566. Reshape the Matrix.py
566. Reshape the Matrix.py
5865.First-Day-Where-You-Have-Been-in-All-the-Rooms.py
5865.First-Day-Where-You-Have-Been-in-All-the-Rooms.py
617. Merge Two Binary Trees.py
617. Merge Two Binary Trees.py
637. Average of Levels in Binary Tree.py
637. Average of Levels in Binary Tree.py
65. Valid Number.py
65. Valid Number.py
657. Judge Route Circle.py
657. Judge Route Circle.py
66. Plus One.py
66. Plus One.py
661.image-smoother.py
661.image-smoother.py
662.maximum-width-of-binary-tree.py
662.maximum-width-of-binary-tree.py
674. Longest Continuous Increasing Subsequence.py
674. Longest Continuous Increasing Subsequence.py
68. Text Justification.py
68. Text Justification.py
683. kEmptySlots.py
683. kEmptySlots.py
684.redundant-connection.py
684.redundant-connection.py
685.redundant-connection-ii.py
685.redundant-connection-ii.py
687. Longest Univalue Path.py
687. Longest Univalue Path.py
692. Top K Frequent Words.py
692. Top K Frequent Words.py
7. Reverse Integer.py
7. Reverse Integer.py
703. Kth Largest Element in a Stream.py
703. Kth Largest Element in a Stream.py
719. Find K-th Smallest Pair Distance.py
719. Find K-th Smallest Pair Distance.py
721.accounts-merge.py
721.accounts-merge.py
724. Find Pivot Index.py
724. Find Pivot Index.py
73. Set Matrix Zeroes.py
73. Set Matrix Zeroes.py
74. Search a 2D Matrix.py
74. Search a 2D Matrix.py
76. Minimum Window Substring.py
76. Minimum Window Substring.py
771. Jewels and Stones.py
771. Jewels and Stones.py
793. Preimage Size of Factorial Zeroes Function.py
793. Preimage Size of Factorial Zeroes Function.py
81. Search in Rotated Sorted Array II.py
81. Search in Rotated Sorted Array II.py
812. Largest Triangle Area.py
812. Largest Triangle Area.py
813. Largest Sum of Averages.py
813. Largest Sum of Averages.py
815. Bus Routes.py
815. Bus Routes.py
819. Most Common Word.py
819. Most Common Word.py
857. Minimum Cost to Hire K Workers.py
857. Minimum Cost to Hire K Workers.py
88. Merge Sorted Array.py
88. Merge Sorted Array.py
9. Palindrome Number.py
9. Palindrome Number.py
905. Sort Array By Parity.py
905. Sort Array By Parity.py
96. Unique Binary Search Trees.py
96. Unique Binary Search Trees.py
View all files
You can’t perform that action at this time.