LeetCodeJ is an open-source project where I solve LeetCode challenges using Java. The aim is to provide efficient and well-documented solutions to a variety of coding problems.
Instructions on how to set up the project on a local machine:
-
Clone the repository:
git clone https://github.com/TheCollinsByte/LeetCodeJ
-
Navigate to the project directory:
cd LeetCodeJ
-
Ensure you have JDK version 21 installed. You can download it here.
-
Compile the project:
./gradlew build
-
Run the project:
./gradlew :{MODULE_NAME}:test -Dtest.verbose=true
Each solution is a separate subproject within the Gradle multi-project setup, organized by specific challenge topics. To verify the solutions, you can run tests for specific subprojects, all tests within a module and all test for all Sub-Projects in verbose mode.
To run all tests within a module, use the following command:
./gradlew :array:test -Dtest.verbose=true
To run a specific test method, use the following command:
./gradlew :array:test --tests com.collo.TwoSumSolverTest.checkPair -Dtest.verbose=true
To run tests for all subprojects in verbose mode:
./gradlew test -Dtest.verbose=true
- Two Sum
- Can Place Flowers
- Kids With the Greatest Number of Candies
- Move Zeroes
- Increasing Triplet Subsequence
- Product of Array Except Self
- Container With Most Water
- Maximum Average Subarray I
- Max Number of K-Sum Pairs
- Merge Strings Alternately
- Greatest Common Divisor of Strings
- Reverse Vowels of a String
- Reverse Words in a String
- Is Subsequence
- Move Zeroes
- String Compression
Contributions are Welcome! Please follow these steps:
- Fork the repository.
- create a new branch (
git checkout -b name-leetcode-challange-number-branch
) - Make your changes and commit them (
git commit -m "Leetcode challange number #1: Solutions"
) - Push to the branch (
git push origin name-leetcode-challange-number-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.