Dynamic programming has a reputation for being the hardest topic in competitive programming. I used to agree with that.

Then I realised something: most DP problems aren't unique. They're variations on about six core patterns. Once you internalise those patterns, you stop treating each DP problem as a new puzzle and start asking: "which pattern is...