These are my solutions to some leetcode problems.
This repository contains solutions to some leetcode problems.
The solutions can be directly tested in Leetcode without aditional steps. To test with the included main program, some other steps will be required.
Click me!
For the time being, this process will be a little bit messy until I finish making all libraries and makefiles necessary to compile each program individually.
$ cd ./leetcode/cpp/lib/
$ make
The console terminal should confirm that there are no errors in the compiling process.
- A
.vscode
directory is located at the root of the project, it includes files to specify the compiling and debugging options to use.
- To compile simply press
Ctrl + Shift + B
. - To debug press
F5
.
- Compile the code of the problem you want to test.
If you are using your own code, be sure to include it after the comment that says //Leetcode solution starts
.
Don't forget to include the .a
file located in /leetcode/cpp/bin/ if a custom library is used.
$ cd ./leetcode/cpp/938-RangeSumOfBST/
$ g++ 938-RangeSumOfBST.cpp ../bin/treeUtils.a -o 938-RangeSumOfBST.bin
- Use of -Wall -Wextra and -pedantic-erros flags is recommended
$ cat testCases | ./938-RangeSumOfBST.bin
Or
$ cat testCases | ./938-RangeSumOfBST.bin > results
Contributions of new test cases or code to improve testing of each problem or upgrade functionality of libraries are always welcome. Better solutions to already solved problems are welcome too.