Simple boilerplate for leetcode warriors
- Clone this repo
- Install LeetCode extension in your vscode
- Configure extension to use
problemsfolder in the repo - Export solution with cases as in
1.two-sum.js
module.exports = {
// ignore: true,
fn: twoSum,
cases: [
{ in: [[2, 7, 11, 15], 9], out: [0, 1] },
{ in: [[11, 2, 15, 7], 9], out: [1, 3] },
],
}npm start
You can ignore problem if you export ignore: true
If you are asked to provide an array of solutions without particular order, you can use helper method to test your functions. See 49.group-anagrams.js