My Java solutions for LeetCode Online Judge.
- Java >= 1.6
- Gradle >= 1.8.6 (1.8.6 is the only version I have tried)
./gradlew eclipse
./gradlew idea
./gradlew question "-Pq=Some Question"
The above command will generate a source file called src/main/java/some_question/SomeQuestion.java
, and you can write your solution in this file directly.
Unit tests are also embedded as inner classes of the main code. For an explanation of this design choice see Ben J. Christensen's JUnit Tests as Inner Classes.
If you write some unit tests, you can use the following command to run them.
./gradlew test