The Gap Reporter
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a sorted list of distinct integers and inclusive bounds lower and upper, return a list of [start, end] pairs covering all integers in [lower, upper] that are NOT in the list. Each pair is a maximal contiguous gap (single integers use [x, x]).
Summary
The missing IDs in the log - somebody has to notice.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.