Collection of leetcode test case scenarios for practice. These Unit test ready for you to use on leetcode problems (may include premium questions.) You run the javascript leetcode test in your IDE with debug mode without paying leetcode premium
Clone this repo
run npm install
this repo contains practice problem playground you can run under
leetcode-playground/
└── /[problemsname].js
open the .js file, you can start exercise of solving problem.
- every problem has respective test case you can run using `Vitest
- It contains test scenarios ready to battle test your solution (You can contribute test case!)
- Tests grouped under
/testsfolder.
- To assist your learning, debugging mode is useful to understand why your code does not work,
- you can attach breakpoint, and run test in debug mode.
- I personally use VScode extension "Jest/ Vitest runner by firsttris". When you open the file, simply click 'debug' to run specific test or describe block. it will run your test in debug mode.
- run
npm run test:perfto enable execution time and memory tracking for every test automatically
- Solution list are located in separate repository to prevent you from unwanted accidental peeking during practice,
- repo link coming soon.
Contributions are welcome! Please see CONTRIBUTING.md for details on how to add new problems or test cases.
you can also look at existing references of leetcode answers in js
https://github.com/JoshCrozier/leetcode-javascript/blob/master/solutions/0464-can-i-win.js
