Is Every Hour Covered?

Medium ⏱ 12 min 48% acceptance ★★★★★ 4.9
Support runs 9:00–21:00. Agent shifts are (start_hour, end_hour) tuples (end exclusive). Write coverage_gaps(shifts) returning the sorted list of uncovered hours in that window — empty means fully staffed.

Examples

Example 1
Input
coverage_gaps([(9, 13), (14, 21)])
Output
[13]
Explanation

Nobody covers the 13:00 hour.

Constraints

  • Window is hours 9 through 20 inclusive.
  • End-exclusive shifts.

Topics

Business Logiccoverage check

Companies

ZomatoSwiggyDunzo

Hints

Hint 1

Build the set of covered hours from all shifts.

Hint 2

Difference against range(9, 21).

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.