This repository contains a collection of coding problems to practice common data structures and algorithms, formatted in the style of LeetCode questions. The problems cover a range of topics such as arrays, linked lists, hash maps, stacks, queues, trees, and graphs, and can be solved in any programming language.
This repository is designed to help developers improve their problem-solving skills by practicing problems based on data structures and algorithms. The problems follow a progression from basic to advanced levels, covering a wide array of real-world scenarios you might encounter in technical interviews.
These problems are language-agnostic, meaning they can be solved in any programming language, such as JavaScript, Python, C++, Java, or Go. Each problem includes clear examples and constraints to help guide your implementation.
-
Clone the repository:
git clone https://github.com/your-username/dsa-practice.git cd dsa-practice
-
Choose a problem from the Problem List.
-
Solve the problem in your preferred programming language. You can create a separate file in the respective folder for the language you're using (e.g.,
arrays/max-product.py
for Python orarrays/max-product.cpp
for C++). -
Test your solution using your local environment or online compilers.
-
Submit pull requests if you want to add or improve existing problems, solutions in other languages, or additional test cases.
To solve a problem, go to the respective folder (e.g., arrays, linked lists) and open the problem's file. After coding the solution in your preferred language, you can test it using your language's environment.
For example, if solving in Python:
python3 arrays/max-product.py
If solving in C++:
g++ arrays/max-product.cpp -o max-product
./max-product
- Maximum Product of Two Integers in an Array – Problem File
- Move Zeroes to End – Problem File
- Find the First Non-Repeating Element – Problem File
- Maximum Sum of a Subarray – Problem File
- Rotate Array – Problem File
- Find All Duplicates in an Array – Problem File
(Coming Soon)
(Coming Soon)
(Coming Soon)
(Coming Soon)
(Coming Soon)
(Coming Soon)
Contributions are welcome! If you'd like to contribute, feel free to submit solutions in different programming languages, add new problems, or improve existing problems.
- Fork the repository.
- Create a new branch:
git checkout -b feature/new-problem
- Add your solution or problem in your preferred language.
- Commit your changes:
git commit -m 'Add solution for max-product problem in Python'
- Push to the branch:
git push origin feature/new-problem
- Open a pull request, and explain your changes.
This project is licensed under the MIT License - see the LICENSE file for details.