Most optional tasks under a daily time limit

0
Remix

Each day has the same time limit. Every day must run its required task; if time allows, it can also run one optional task. You get n required durations (one per day) and n optional durations that can go on any day. Return the most optional tasks you can schedule without any day going over the limit. For example, with limit 7, required [4, 5, 2, 4] and optional [5, 6, 3, 4], two optional tasks fit.

AmazonOnline assessmentLast asked Sep 2025
No answer yet. Write the first one; the best answer gets endorsed.