Most tasks done before their deadlines
Each task is [duration, deadline]: it takes duration days of work and counts only if it is finished by day deadline. You start on day 0, work on one task at a time and never pause a task once started. Choose which tasks to do and in what order to finish as many on time as possible; return that number.
A task started on day t finishes on day t + duration, which must not pass its deadline. Durations and deadlines are positive integers, and tasks may be empty.
Besides the tests, one large input (3,000 tasks) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
most_on_time([[3,3],[2,4],[2,5]])→2most_on_time([[1,10],[2,2]])→2most_on_time([[5,6],[1,6],[1,6],[1,6]])→3