Ctrl K
Problem

No Back-to-Back Shifts

Medium · No Back-to-Back Shifts

A courier is offered side work for the coming days: `pay[i]` is what they earn by taking the shift on day `i`. Working two days in a row is not allowed: every shift has to be followed by at least one day off. The courier picks which days to work (any number of days, possibly none). Return the largest total they can earn.…

Solve the problem →