shifts[i] = [a, b] means someone is on duty every day from a through b inclusive. Ranges may overlap.
Given first and last, return True if **every** day from first through last inclusive is covered by at least one shift, and False if some day has nobody on duty.shifts=[[1, 4], [5, 8], [8, 12]], first=3, last=10 → True
Days 3–4 fall in the first shift, 5–8 in the second, 9–10 in the third.
shifts=[[2, 5], [7, 9]], first=4, last=8 → False
Day 6 is not in any shift.
shifts=[[10, 10]], first=10, last=10 → True
Only day 10 must be covered, and there is a shift for exactly that day.
len(shifts) ≤ 50a ≤ b ≤ 50 for each shifts[i] = [a, b]first ≤ last ≤ 50shifts=[[1, 4], [5, 8], [8, 12]], first=3, last=10
True
Run checks the first 3 tests in your browser. Submit checks all 108 tests on the server, hidden ones included.