You are given two tasks and shifts.
The array tasks represents a sequence of tasks that must be processed in order, where tasks[i] is the amount of time required to complete the shifts represents consecutive work shifts, where shifts[i] is the time available during the
Tasks are completed sequentially starting from task
During a shift, time is spent on tasks in order. A task can be partially completed and will keep its progress for following shifts.
If all tasks are completed within a shift, any remaining time in that shift is discarded, and all tasks reset so that processing restarts from task
If all tasks are not completed, work continues in the next shift from the point where it stopped.
Return an integer array ans where ans[i] is the number of unfinished tasks at the end of the
Constraints:
tasks.length
shifts.length
tasks[i]
shifts[i]
You are given two tasks and shifts.
The array tasks represents a sequence of tasks that must be processed in order, where tasks[i] is the amount of time required to complete the shifts represents consecutive work shifts, where shifts[i] is the time available during the
Tasks are completed sequentially starting from task
During a shift, time is spent on tasks in order. A task can be partially completed and will keep its progress for following shifts.
If all tasks are completed within a shift, any remaining time in that shift is discarded, and all tasks reset so that processing restarts from task
If all tasks are not completed, work continues in the next shift from the point where it stopped.
Return an integer array ans where ans[i] is the number of unfinished tasks at the end of the
Constraints:
tasks.length
shifts.length
tasks[i]
shifts[i]