Skip to content

rickvian/leetcode-javascript-practice-playground

Repository files navigation

LeetCode JavaScript Practice Playground Logo

JS Leetcode practice ground

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

How to use this repo

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.

Run test

  • 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 /tests folder.

debug mode

Tips for debugging

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

Performance Profiling (optional)

  • run npm run test:perf to enable execution time and memory tracking for every test automatically

Solution list

  • Solution list are located in separate repository to prevent you from unwanted accidental peeking during practice,
  • repo link coming soon.

Contributing

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

https://github.com/everthis/leetcode-js

https://github.com/sir-gon/algorithm-exercises-js

About

Run your leetcode test in your IDE, Debug with these collection of unit test

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages