Welcome to the NeetCode 150 Solutions Repository!
This repo is a community effort to collect clean, structured, and multi-language solutions for the NeetCode 150 problems.
👉 GitHub Repo: ayushmehta03/neetcode-soln
Whether you’re solving in Python, Java, C, Go, Kotlin, or any other language, your contributions are welcome! 🙌
The repo follows a language → topic → solution format:
├── Python/ │ ├── Arrays/ │ │ └── two_sum.py │ ├── DP/ │ │ └── longest_increasing_subsequence.py │ ├── Java/ │ ├── Arrays/ │ │ └── TwoSum.java │ ├── DP/ │ │ └── LIS.java │ ├── C/ │ ├── Arrays/ │ │ └── two_sum.c │ ├── DP/ │ │ └── lis.c
- Language folder → Name after the programming language (
Python,Java,C,Go,Kotlin, etc.) - Topic folder → Organize solutions into categories like:
ArraysDP(Dynamic Programming)GraphsTreesStringsBacktrackingGreedy
- Solution file → Use clear descriptive names like
two_sum.py,TwoSum.java,lis.c
-
Write Clean & Optimal Code
- Keep it simple, efficient, and readable.
- Avoid unnecessary complexity.
-
Add Comments
- Briefly explain your approach at the top.
- Use inline comments where needed.
-
Follow Naming Conventions
- Python, C, Go →
snake_case→two_sum.py - Java, Kotlin →
CamelCase→TwoSum.java
- Python, C, Go →
-
Avoid Duplicates
- Check if the problem is already solved in that language.
- If you add a different approach, explain it clearly in comments.
-
Stick to the Folder Structure
- Always follow
Language/Topic/solution_fileformat. - Don’t put files in the root directory.
- Always follow
-
Fork this repo → ayushmehta03/neetcode-soln
-
Create a new branch for your contribution
git checkout -b add-two-sum-python
-
Add your solution in the correct folder
-
Commit changes with a meaningful message
git commit -m "Add Python solution for Two Sum"
- Push to your fork and open a Pull Request 🎉
🌟 Example
If you’re adding a Python solution for Two Sum (Arrays problem), create:
Python/Arrays/two_sum.py
Inside two_sum.py:
def twoSum(nums, target): num_map = {} for i, num in enumerate(nums): if target - num in num_map: return [num_map[target - num], i] num_map[num] = i
🙌 Final Notes
Let’s keep this repo organized and beginner-friendly.
Every contribution, big or small, is appreciated ❤️
Star ⭐ this repo to support the project → ayushmehta03/neetcode-soln