Welcome to the DSA for Interview repository! This repository is dedicated to solving data structures and algorithms (DSA) questions from LeetCode in Go, JavaScript and Ruby. Our goal is to help others learn and contribute by providing well-explained, efficient solutions to various DSA problems.
Feel free to contribute by adding your solutions or improving existing ones! 🤝
- Fork this repository.
- Create a new branch for your solution.
- Add your solution under the respective language folder (
go/
orjavascript/
orruby/
). - Update the corresponding table in the
README.md
with the problem details. - Open a pull request, and we will review and merge it.
.
├── go/ # Go solutions
├── javascript/ # JavaScript solutions
├── ruby/ # Ruby solutions
└── README.md # Repository details and problem tracking
Below is the list of LeetCode DSA problems solved in Go and JavaScript. Each row links to the specific LeetCode problem and the corresponding solution.
# | Problem | Type | Difficulty | Solution |
---|---|---|---|---|
1 | Two Sum | Array | Easy | Go Solution |
2 | Longest Common Prefix | Array | Easy | Go Solution |
3 | Palindrome Number | Math | Easy | Go Solution |
4 | Remove Duplicates from Sorted List | Linked List | Easy | Go Solution |
5 | Best Time to Buy and Sell Stock | Array | Easy | Go Solution |
6 | Container with Most Water | Array | Medium | Go Solution |
7 | Rotate Image | Array | Medium | Go Solution |
8 | Rotate List | Linked List | Medium | Go Solution |
9 | Search in Rotated Sorted Array | Array, Binary Search | Medium | Go Solution |
10 | Trapping Rain Water | Array | Hard | Go Solution |
11 | Find First and Last Position of Element in Sorted Array | Array, Binary Search | Medium | - |
12 | Remove Duplicates from Sorted Array II | Array | Medium | Go Solution |
13 | Search Insert Position | Array | Easy | Go Solution |
14 | Valid Sudoku | Array | Medium | Go Solution |
15 | Count and Say | Array | Medium | Go Solution |
16 | Add Two Numbers | Linked List | Medium | Go Solution |
... | ... | ... | ... | ... |
# | Problem | Type | Difficulty | Solution |
---|---|---|---|---|
1 | Two Sum | Array | Easy | - |
2 | Longest Common Prefix | Array | Easy | - |
3 | Palindrome Number | Math | Easy | - |
4 | Remove Duplicates from Sorted List | Linked List | Easy | - |
5 | Best Time to Buy and Sell Stock | Array | Easy | - |
6 | Container with Most Water | Array | Medium | - |
7 | Rotate Image | Array | Medium | - |
8 | Rotate List | Linked List | Medium | - |
9 | Search in Rotated Sorted Array | Array, Binary Search | Medium | - |
10 | Trapping Rain Water | Array | Hard | - |
11 | Find First and Last Position of Element in Sorted Array | Array, Binary Search | Medium | - |
12 | Remove Duplicates from Sorted Array II | Array | Medium | - |
13 | Search Insert Position | Array | Easy | - |
14 | Valid Sudoku | Array | Medium | - |
15 | Count and Say | Array | Medium | - |
16 | Add Two Numbers | Linked List | Medium | - |
... | ... | ... | ... | ... |
# | Problem | Type | Difficulty | Solution |
---|---|---|---|---|
1 | Two Sum | Array | Easy | - |
2 | Longest Common Prefix | Array | Easy | - |
3 | Palindrome Number | Math | Easy | - |
4 | Remove Duplicates from Sorted List | Linked List | Easy | - |
5 | Best Time to Buy and Sell Stock | Array | Easy | Ruby Solution |
6 | Container with Most Water | Array | Medium | - |
7 | Rotate Image | Array | Medium | Ruby Solution |
8 | Rotate List | Linked List | Medium | - |
9 | Search in Rotated Sorted Array | Array, Binary Search | Medium | - |
10 | Trapping Rain Water | Array | Hard | - |
11 | Find First and Last Position of Element in Sorted Array | Array, Binary Search | Medium | - |
12 | Remove Duplicates from Sorted Array II | Array | Medium | - |
13 | Search Insert Position | Array | Easy | - |
14 | Valid Sudoku | Array | Medium | - |
15 | Count and Say | Array | Medium | - |
16 | Add Two Numbers | Linked List | Medium | - |
... | ... | ... | ... | ... |
- Ensure your code is clean, well-documented, and follows best practices.
- Add the LeetCode problem link and the solution link in the respective table above.
- Feel free to optimize or add new solutions!
Happy coding! 😄