Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 986 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 986 Bytes

leetcode-java

My Java solutions for LeetCode Online Judge.

Build Status

Build Status

Requirements

  • Java >= 1.6
  • Gradle >= 1.8.6 (1.8.6 is the only version I have tried)

Generate an eclipse project

gradle eclipse

Generate a file for a question

gradle 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.

Run unit tests

If you write some unit tests, you can use the following command to run them.

gradle test