Maximize profit from selling m tickets across n windows
Filed under LinkedIn
The question
There are `n` ticket windows, where the `i`-th window has `a[i]` tickets available. The price of a ticket equals the current number of tickets remaining at that window. Calculate the maximum total money earned after selling `m` tickets.
No write-up yet. Related questions below have one.
Related LinkedIn questions
Collected from public candidate posts and coding forums. Updated Nov 2026.