State-Machine & Bitmask DP

Advanced · 22 min read · Problem-Solving Patterns, Dynamic Programming

Stock problems as a few states per day, and subsets of a small set as the state.

This is an Advanced lesson, part of Premium. What it covers:

  • State-machine DP: one variable per state
  • Bitmask DP: the set of things done so far
  • Practice ladder
  • Interview questions
  • Further reading

Previous: Tree & Interval DP · Next: Greedy