This repo contains my solutions to LeetCode problems I have solved in Python.
In my solutions, I briefly explain the optimal approach (and any other approaches if applicable) and then code it up. Time and space complexities are also provided.
In the table below, you will find the original LeetCode problem and my solution to it.
| # | Title | Difficulty | Solution |
|---|---|---|---|
| 1 | Two Sum | Easy |
Python |
| 2 | Add Two Numbers | Medium |
Python |
| 3 | Longest Substring Without Repeating Characters | Medium |
Python |
| 4 | Median of Two Sorted Arrays | Hard |
Python |
| 9 | Palindrome Number | Easy |
Python |
| 11 | Container With Most Water | Medium |
Python |
| 13 | Roman to Integer | Easy |
Python |
| 14 | Longest Common Prefix | Easy |
Python |
| 15 | 3Sum | Medium |
Python |
| 17 | Letter Combinations of a Phone Number | Medium |
Python |
| 19 | Remove Nth Node From End of List | Medium |
Python |
| 20 | Valid Parentheses | Easy |
Python |
| 21 | Merge Two Sorted Lists | Easy |
Python |
| 22 | Generate Parentheses | Medium |
Python |