20 September 2026 · Advanced track
Zone Coverage Window
Find the shortest consecutive check-in run that gives both specified zones enough coverage.
A community event logs check-ins by zone in the order they happen. You are given the full check-in list, two different zone names, and a required number of check-ins for each zone. Find the shortest consecutive run of check-ins that contains at least the required number from both specified zones. Check-ins from other zones may appear inside the run. Return the inclusive index range [start, end] for that run. If multiple shortest runs exist, return the one that starts earliest. If no run has enough check-ins from both zones, return [-1, -1].
Constraints
checkins contains from 0 to 20,000 lowercase ASCII zone namesfirst_zone and second_zone are different lowercase ASCII namesminimum is an integer from 1 to 10,000Returned indexes are zero-based and inclusive
Function signature
def shortest_coverage_window(checkins, first_zone, second_zone, minimum):