Problem 2838 · Medium

Maximum Coins Heroes Can Collect

Sort monsters by strength, precompute coin prefix sums, and binary search how many monsters each hero can beat.

Open the interactive visualisation