A collection of my solutions to various LeetCode problems in Python, SQL, and other languages.
The repository is organized into two main directories:
- Python: Contains solutions to algorithm and data structure problems
- SQL: Contains solutions to database query problems
Each problem solution is stored in its own directory, named with the problem number and title (e.g., 1-two-sum
). Each problem directory typically includes:
- A detailed README.md with the problem description
- The solution file(s) in the appropriate language (Python, Java, SQL, Go,)
# | Problem | Solution | Difficulty |
---|---|---|---|
1 | Two Sum | Python, Java | Easy |
2 | Add Two Numbers | Python | Medium |
5 | Longest Palindromic Substring | Python | Medium |
6 | Zigzag Conversion | C++ | Medium |
9 | Palindrome Number | Python | Easy |
14 | Longest Common Prefix | Python | Easy |
15 | 3Sum | Python | Medium |
20 | Valid Parentheses | Python | Easy |
36 | Valid Sudoku | Python | Medium |
49 | Group Anagrams | Python | Medium |
125 | Valid Palindrome | Python | Easy |
160 | Intersection of Two Linked Lists | Python | Easy |
167 | Two Sum II - Input Array Is Sorted | Python | Easy |
217 | Contains Duplicate | Java | Easy |
238 | Product of Array Except Self | Python | Medium |
242 | Valid Anagram | Python | Easy |
1035 | Cousins in Binary Tree | Python | Easy |
1047 | Maximize Sum Of Array After K Negations | Python | Easy |
1470 | Tweet Counts Per Frequency | Python | Medium |
1524 | String Matching in an Array | Go | Easy |
1899 | Count Items Matching a Rule | Python | Easy |
1910 | Check If Binary String Has At Most One Segment of Ones | Python | Easy |
3450 | Find The Child Who Has The Ball After K Seconds | Python | Easy |
# | Problem | Solution | Difficulty |
---|---|---|---|
197 | Rising Temperature | SQL | Easy |
347 | Top K Frequent Elements | Python | Medium |
577 | Employee Bonus | SQL | Easy |
584 | Find Customer Referee | SQL | Easy |
585 | Investments in 2016 | SQL | Medium |
595 | Big Countries | SQL | Easy |
1153 | Product Sales Analysis I | SQL | Easy |
1182 | Game Play Analysis IV | SQL | Medium |
1258 | Article Views I | SQL | Easy |
1292 | Immediate Food Delivery II | SQL | Medium |
1338 | Queries Quality and Percentage | SQL | Easy |
1390 | Average Selling Price | SQL | Easy |
1509 | Replace Employee ID With The Unique Identifier | SQL | Easy |
1724 | Customer Who Visited but Did Not Make Any Transactions | SQL | Easy |
1801 | Average Time of Process per Machine | SQL | Easy |
1827 | Invalid Tweets | SQL | Easy |
1908 | Recyclable and Low Fat Products | SQL | Easy |
- Python
- SQL
- Java
- Go
- C++
- Browse the directories to find a specific problem.
- Each problem directory contains:
- Problem description in README.md
- Solution file(s)
- Sometimes multiple solution approaches
Feel free to suggest improvements to any solution by opening an issue or pull request.
This repository is available under the MIT License. Feel free to use the code for personal learning and practice.