Track Complete Coverage on a Number Line
Maintain permanent pollution coverage on the closed interval [0, 50]. Calling add(x) adds [x - 0.5, x + 0.5] ∩ [0, 50]. Return whether the entire interval [0, 50] is covered after each inserti...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
