Practice40 min

Practice: Clever Commitments

Building runs from the smallest card, filtered triplet merging, last-occurrence partitioning, and min/max open-paren ranges.

Each of these hides its greedy rule: start every run at the smallest remaining card, only merge triplets that never exceed the target, cut partitions at last occurrences, and track a range of possible open-paren counts instead of one.

Solving all problems completes this lesson automatically.