A thousand tiny steps turn into LC legend!
this repo records each step as a solution so the grind eventually makes you the algorithm sage you’re chasing. Every src/<topic> folder carries a guide plus implementations and Jest specs, letting you move from idea to proof without pausing to hunt for context.
src/<topic>/<problem-id-name>/: Source, Jest spec, and optional notes for each puzzle (e.g.src/array/189-rotate-array/189.ts).src/<topic>/readme.md: Topic playbook that explains the approach for that data structure/question type.build/src/...: Generated JavaScript afternpm run compile. Never edit the build artifacts directly.static/: Diagrams and supporting material such asstatic/img/binary-tree/review.png.- Scripts:
npm run compile(tsc tobuild/),npm run test(compile + Jest + lint),npm run lint(gts checks), andnpm run fix(auto-format).
- Array patterns
- Binary search tree flow
- Binary tree traversals
- Hash map & counting
- Interval scheduling
- Linked list mechanics
- Matrix simulation
- Sliding window control
- Stack & queue utilities
- String transformations
- Two-pointer drills
- Pick a problem, open its folder under
src/<topic>/<problem-id-name>/, and read the topic guide insrc/<topic>/readme.md. - Implement or update the solution in
<id>.tswith the recommended pattern (two pointers, BFS, etc.). - Keep changes type-safe:
npm run compilesurfaces TypeScript errors even before running tests. - When exploring new ideas, capture strategy notes in a local
README.mdinside the problem folder.
- In
src/<topic>/<problem-id-name>/, locate the existing<id>.spec.tsor create a new one beside the solution file. - Import the exported function(s) from
<id>.ts. - Use Jest
describeblocks named after the problem and includeitcases for happy paths, edge cases, and regressions. - Run
npm run test -- <pattern>to focus on a single spec ornpm run testfor the full suite.
