Wake up, do some algos.
NodeJS (reasonable version). NodeJS installation instructions at https://nodejs.org
Note: local latest nodejs version will be used for npm scripts
npm install
$ npm run create KYU_LEVEL PROBLEM_NAME FUNCTION_NAMEmakes./KYU_LEVEL'Kyu'-PROBLEM_NAME/index.tswithFUNCTION_NAMEin a boilerplate, Solve using RxJS, and Rambda Example;
npm run create 8 RemoveFirstAndLastCharacter removeChar$ npm run buildmakes./PROBLEM_NAME/build.js, paste contents to answer pane of your choice such as Codewars.
- Create and move to folder of an algorithm and create
index.ts. (manually for classic problems)
npm startwill runindex.tsin current folder(cwd). (using ts-node)
- create
spec.tsnext toindex.tsExample;
0-classic
|- BinarySearch
|- index.ts ## Where solution is written
|- spec.ts ## Where test is writtern for ./index.ts
Inside spec.ts
import binarySearch from './index';
test(desc, () => {
expect(binarySearch(input.sorted, input.targetNum)).toEqual(result.index)
});-
npm run test:watchto automatically rerun rests for changed(uncommitted files) files. -
npm tornpm run testto run test for changed(uncommitted) files only. -
npm run test:allto run test for all files.
-
npm run checkto check available package.json updates. -
npm run updateto upgrade all packages and package.json to latest versions.