You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The motivation behind this project is to be able to practice LeetCode problems on a plane without requiring an internet connection (until Starlink ramps up). It is by no means intended to replace or replicate leetcode.com.
5
+
The motivation behind this project is to be able to practice LeetCode problems on a plane without requiring an internet connection (until Starlink ramps up). This project is not intended to replace or replicate leetcode.com.
6
6
7
7
## Table of Contents
8
8
@@ -21,67 +21,83 @@ The motivation behind this project is to be able to practice LeetCode problems o
The above example runs **TwoSum** problem using **C++**.
41
-
After the build succeeds the following directory structure will be generated in the folder specified by ``--problem_builds_dir`` flag. In this example it's a folder called ``problem_builds`` as follows:.
58
+
After the build succeeds, the following directory structure will be generated:
42
59
43
-
- problem_builds
44
-
- problems
45
-
- TwoSum
46
-
- cpp
47
-
- solution.cpp
48
-
- ...
49
-
- testcases
50
-
- TestCase1.test
51
-
- TestCase2.test
52
-
- ...
53
-
- description.md
54
-
- launguage
55
-
- cpp
60
+
- problems
61
+
- NumberOfIslands
62
+
- cpp
63
+
- solution.cpp
64
+
- ...
65
+
- testcases
66
+
- TestCase1.test
67
+
- TestCase2.test
68
+
- ...
69
+
- description.md
70
+
- TwoSum
71
+
- ..
72
+
- launguage
73
+
- cpp
56
74
57
-
Just like for LeetCode you have one file where you solve the problem. For example, for the problem called TwoSum there is **problem_builds/problems/TwoSum/cpp/solution.cpp**. To add new test cases you can create a file in **problem_builds/problems/TwoSum/testcases/** directory with the extension **.test** and your solution will be automatically tested against it.
75
+
Just like for LeetCode you have one file where you solve the problem. For example, the problem called TwoSum has **problems/TwoSum/cpp/solution.cpp**. To add a new test cases you can create a file in **problems/TwoSum/testcases/** directory with file extension **.test** and the solution will automatically be tested against it.
58
76
59
-
The problem is a LeetCode problem description in the ***description.md*** file location in the directory for each problem. For example ***problem_builds/problems/TwoSum/description.md***.
77
+
Each problem is described in the ***description.md*** file location in the problem's directory. For example ***problems/TwoSum/description.md***.
60
78
61
-
The format of the .test files are as follows
79
+
The format of the .test files are as follows:
62
80
63
81
```text
64
-
arg1
65
-
arg2
66
-
expected results
82
+
<arg1>
83
+
<arg2>
84
+
<expected results>
67
85
```
68
86
69
-
Each line is either an integral type (1, 4.6 etc.), or an array of integral types. For example:
87
+
Each line is either an integral type, a string, or an array. For example:
70
88
71
89
```text
72
-
[1, 2, 4]
90
+
["1", "2", "4"]
73
91
8.0
74
92
[0, 0]
75
93
```
76
94
77
-
For C++ the supported types are: integral types, strings, vector of integral types.
78
-
79
95
## List of LeetCode Problems
80
96
* TwoSum
81
97
* LongestSubstringWithoutRepeatingCharacters
82
98
* NumberOfIslands
83
99
84
-
The problem names are automatically extracted from the folder names inside **data/problems/**.
100
+
The problem names are automatically extracted from the **problems** folder.
85
101
86
102
## Usage
87
103
```text
@@ -99,14 +115,16 @@ options:
99
115
--problem problem_name, -p problem_name
100
116
Name of the problem to build and test. Default: TwoSum. Use --list-problems to list all problems.
101
117
--problem_builds_dir dir, -d dir
102
-
Path to a directory with the problems. Usually ./problem_builds/ directory. Default: problem_builds.
118
+
Specifies the directory with the problems. Typically, this is './problem_builds'. If not provided, the script defaults to './problem_builds' in the same directory as the executable.
119
+
--run-expected-tests, -r
120
+
Run the expected solution. Default: False.
103
121
--testcase testcase_name, -t testcase_name
104
122
Name of the testcase to run. '--testcase All' will run all testcases. Default: All.
105
123
--verbose, -v Print verbose output
106
124
```
107
125
108
126
## Note
109
-
Curently only C++ is supported but the framework is setup such that other languages can be added. Also, the question description and the solution is yet to be worked on.
127
+
Curently only C++ is supported but the framework is setup such that other languages can be added.
110
128
111
129
## Requirements
112
130
This project requires the following to run:
@@ -115,6 +133,9 @@ This project requires the following to run:
115
133
- CMake 3.12
116
134
- Git
117
135
136
+
#### Additional Requirements for the UI
137
+
- npm
138
+
118
139
## Contributing
119
140
Feel free to contribute with code, test cases, or even code reviews.
0 commit comments