← Back
00:00

Range Coverage Tracker

Lyft interview questions · Medium · Coding round · 6 tests

You are painting a road of total length n. A paint stroke started at integer position x covers exactly the unit segment [x, x + 1].

Interface

class RangeTracker {
  constructor(n: number);
  paint(x: number): void;
  isFullyCovered(): boolean;
}

Rules

Idle