Fit the Most Tasks

Medium · rating 1400 · Greedy, Sorting

You have T minutes and a list of task durations. The first line has n and T. The second line has n durations. Print the maximum number of tasks you can finish within the time budget.

Constraints: 1 ≤ n ≤ 105

Related problems

Open Fit the Most Tasks in Code Arena →