The aim of this repository is to contain optimized solutions solved in multiple programming languages for a large set of problems (450+) from Love Babbar's DSA list.
You can add your solutions or if you believe that your solution is more optimized than the existing one in the repository, feel free to open a Pull Request (PR) with your improved version.
- Overview
- Contributing
- Repository Structure
- Supported Languages
- How to Add Your Solution
- Test Your Solutions
The problems are sourced from popular platforms like LeetCode, GeeksforGeeks, HackerRank, etc., and are sorted into categories such as:
- Arrays
- Matrix
- String
- Searching and Sorting
- Linked Lists
- Binary Trees
- And more!
Each problem has:
- A problem statement (
problem_statement.md
) - A solution in multiple languages (e.g., Python, Java, C++)
- Optional test cases for validating the solution
We encourage contributions from everyone! Here's how you can get involved:
- Create an issue
- Fork this repository
- Clone it to your local machine
- Choose a problem or category
- Add or update a solution in your preferred language
- At the bottom of your solution file, please add Time and Space Complexities of your code in form of comments.
- Commit your changes and push them to your fork
- Create a Pull Request (PR) with a description of the changes and screenshot of passed test cases on any platform.
- Link the issue with the PR to close it when PR gets merged.
If you want to help improve the repository or have suggestions for new features, feel free to open an issue!
The repository is organized by categories and subfolders for each problem. Here's an example structure:
- 01 Array
- 01 reverse_the_array
- problem_statement.md # Problem description
- python
- 01 reverse_the_array.py # Python solution
- java
- 01 reverse_the_array.java # Java solution
- cpp
- 01 reverse_the_array.cpp # C++ solution
- Each category folder contains problems.
- Inside each problem folder:
problem_statement.md
contains the problem description.- Language-specific folders (e.g.,
python
,java
,cpp
) contain the respective solutions. - Optionally, there might be test files for validating solutions.
We encourage contributors to add solutions in any language of their choice!
To add a new solution:
- Navigate to the appropriate category folder (e.g.,
01 Array
). - Create a new folder for the problem (e.g.,
01 reverse_the_array
). - Add the following:
- problem_statement.md: The problem description (you can use the template provided).
- Solution file(s): Add your solution in the language of your choice with time and space complexities in comments.
- Once you're done, commit your changes and create a pull request.
We recommend that you test your solution thoroughly before submitting it. If your solution passes all the test cases on the respective platform (e.g., LeetCode, GeeksforGeeks), you can proceed with submitting it.
Thank you for contributing! 🚀