This is the repo of my LeetCode solutions, and currently I just use JavaScript to solve the questions, maybe in the future, I will use other languages I like to get the ALL PASS grade.
First of all, you need to install all dependencis:
npm i
By executing the command you can browse all the problems in your terminal, and select any one to solve.
npm run question
I've used Mocha and Chai to test the programs, the test cases are defined in the problems/*/test-cases.js:
npm test # test all test cases
npm test [problem number] # test single problem
This table lists all the submissions in this repo, and there is a command provided to update this part.
npm run generate-readme
| Sequence | Title | Difficulty | Submission |
|---|---|---|---|
| 1 | Two Sum | Easy | 001_two-sum |
| 2 | Add Two Numbers | Medium | 002_add-two-numbers |
| 3 | Longest Substring Without Repeating Characters | Medium | 003_longest-substring-without-repeating-characters |
| 6 | ZigZag Conversion | Medium | 006_zigzag-conversion |
| 9 | Palindrome Number | Easy | 009_palindrome-number |