Solutions to LeetCode problems in Python.
python add.py <problem_number>This will:
- Fetch the problem title, difficulty, and link from LeetCode
- Generate a file in
main/with the solution stub and example test cases pre-filled - Print an error if the problem already exists or requires a Premium subscription
Example:
python add.py 53
# Created: main/0053_maximum_subarray.py [Medium]Once the file is created, fill in your solution. The expected outputs in each assert are already filled in.
last updated June 21, 2026
🟢 Easy (5)
| # | Title | Solution |
|---|---|---|
| 1 | Two Sum | code |
| 14 | Longest Common Prefix | code |
| 70 | Climbing Stairs | code |
| 88 | Merge Sorted Array | code |
| 643 | Maximum Average Subarray I | code |
🟡 Medium (13)
| # | Title | Solution |
|---|---|---|
| 2 | Add Two Numbers | code |
| 3 | Longest Substring Without Repeating Characters | code |
| 11 | Container With Most Water | code |
| 53 | Maximum Subarray | code |
| 152 | Maximum Product Subarray | code |
| 198 | House Robber | code |
| 200 | Number of Islands | code |
| 207 | Course Schedule | code |
| 221 | Maximal Square | code |
| 300 | Longest Increasing Subsequence | code |
| 787 | Cheapest Flights Within K Stops | code |
| 918 | Maximum Sum Circular Subarray | code |
| 1584 | Min Cost to Connect All Points | code |
🔴 Hard (5)
| # | Title | Solution |
|---|---|---|
| 23 | Merge k Sorted Lists | code |
| 42 | Trapping Rain Water | code |
| 329 | Longest Increasing Path in a Matrix | code |
| 1235 | Maximum Profit in Job Scheduling | code |
| 1751 | Maximum Number of Events That Can Be Attended II | code |