Skip to content

BlackNinjaKR/Leetcode_Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode Solutions in Java, C, and C++

A collection of Java, C, and C++ solutions to various Leetcode problems. This repository provides multiple language implementations for algorithm practice and serves as a reference for learners and enthusiasts who want to understand different approaches and paradigms across languages.


About

Each solution is provided in one or more of the supported languages:

  • Java
  • C++
  • C

Each solution typically includes:

  • Problem statement: A summary of the problem, including constraints and examples.
  • Solution approach: A brief explanation of the intuition, approach, and complexity analysis.
  • Code: Well-documented source code with comments to clarify logic.

The repository is updated periodically with new solutions and language variants.


Solution Structure

Solutions are organized by language:

Leetcode-Solutions/
│
├── Java/
│   ├── PalindromeNumber.java
│   └── ReverseInteger.java
│
└── C&C++/
    ├── PalindromeNumber.c
    └── PalindromeNumber.cpp
    └── ReverseInteger.c
    └── ReverseInteger.cpp

Each file is self-contained and named to reflect the problem it addresses.

Usage

You can clone or download the repository to explore and run solutions locally.

# Clone the repository
git clone https://github.com/yourusername/Leetcode-Solutions.git
cd Leetcode-Solutions

To run JAVA solutions:

cd Java
javac ProblemName.java
java ProblemName

To run C&C++ solutions:

cd C&C++
g++ ProblemName.cpp -o ProblemName
./ProblemName

Make sure you have the appropriate compilers installed:

  • Java: JDK
  • C++: g++
  • C: gcc

Contributing

If you have alternate implementations, optimizations, or want to add solutions in a new language, contributions are welcome!

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/new-solution).
  3. Add your changes and commit (git commit -am "Add solution for [Problem Name] in [Language]").
  4. Push to your fork and open a pull request.

License

This repository is licensed under the MIT License. See the LICENSE file for details.


Happy coding, and best of luck with your Leetcode practice!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published