Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Annotated algorithm notes

Annotated solutions to interview and competitive-programming problems in Python, TypeScript, and Rust.

Five good places to start

  1. Longest Common Subsequence derives the dynamic-programming recurrence from optimal substructure, then works through a complete table by hand.
  2. Largest Rectangle in a Histogram explains the monotonic stack in terms of the rectangles that remain possible, including the subtle meaning of each stored start index.
  3. Pacific Atlantic Water Flow turns the problem around: instead of tracing water downhill from every cell, it flood-fills uphill from both oceans.
  4. Binary Tree Maximum Path Sum uses post-order traversal to distinguish a complete path at a node from the one-sided path that can be extended by its parent.
  5. Two Knights develops a closed-form counting argument by subtracting the attacking configurations, found through the geometry of 2-by-3 rectangles, from all possible placements.

For a broader guide to choosing techniques, see “Is dismissing the algorithmic tech interview a memetic hazard?”.

The rest of the repository contains solutions from NeetCode, CSES, and CodeSignal.

About

Annotated solutions to interview and competitive-programming problems in Python, TypeScript, and Rust.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages