29/42
Part 7 of 8 · The worked exampleLearn and do
A worked example: the fewest shifts that cover two weeks
The prompt: engineers offer on-call shifts as closed day ranges, and the rotation runs from day 1 through day 14. Return the fewest shifts that together cover every day, or -1 if they can't. Here are the shifts:
Shifts (1, 3), (1, 5), (2, 8), (4, 6), (6, 12), (7, 10), (9, 14), (11, 14) and (13, 14) cover days 1 to 14. What's the fewest that cover every day?
Pick an answer above to see the rest