
beginner
10 min read
Integer to Roman
The code is short. The trap is assuming the rules are short enough for a pile of special cases.
View solutionMake provably safe local choices that lead to a globally optimal result.
Problems
Practice problems that share this primary solution pattern and compare the clues that reveal it.

The code is short. The trap is assuming the rules are short enough for a pile of special cases.
View solution
The wrong mental model is a tree of jump paths. The useful model is a moving boundary: the farthest index reachable by any valid path found so far.
View solution
The common mistake in a Jump Game II solution is to commit too early: “From this index, which landing position should I choose?” That creates a path-search…
View solution