Skip to content

TheCollinsByte/LeetCodeJ

Repository files navigation

Description

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.

Installation

Instructions on how to set up the project on a local machine:

  1. Clone the repository:

    git clone https://github.com/TheCollinsByte/LeetCodeJ
  2. Navigate to the project directory:

    cd LeetCodeJ
  3. Ensure you have JDK version 21 installed. You can download it here.

  4. Compile the project:

    ./gradlew build
  5. Run the project:

    ./gradlew :{MODULE_NAME}:test -Dtest.verbose=true

Usage

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.

Run all test within a module in verbose mode

To run all tests within a module, use the following command:

./gradlew :array:test -Dtest.verbose=true

Run a specific Test Method in verbose mode

To run a specific test method, use the following command:

./gradlew :array:test --tests com.collo.TwoSumSolverTest.checkPair -Dtest.verbose=true

Run Tests for All Subprojects in verbose Mode

To run tests for all subprojects in verbose mode:

./gradlew test -Dtest.verbose=true

Solutions

Arrays

String

Contributing

Contributions are Welcome! Please follow these steps:

  1. Fork the repository.
  2. create a new branch (git checkout -b name-leetcode-challange-number-branch)
  3. Make your changes and commit them (git commit -m "Leetcode challange number #1: Solutions")
  4. Push to the branch (git push origin name-leetcode-challange-number-branch).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.



⭐ hit the star button if you found this useful ⭐

Source | Twitter | LinkedIn | Email

Releases

No releases published

Packages

No packages published

Languages