Problem 2830 · Medium

Maximize the Profit as the Salesman

Choose non-overlapping house ranges to maximise gold, with a prefix table indexed by the house where each offer ends.

Open the interactive visualisation