16 September 2026 · Advanced track
Repeat Calibration Level
Find the first pair of calibration checkpoints that end at the same cumulative level.
A device is recalibrated by applying adjustments in order. The device starts at level 0, and each integer change raises or lowers its level. After each change, record the resulting level. Return a two-item list [earlier_checkpoint, later_checkpoint] for the first checkpoint that reaches a level already reached at an earlier checkpoint. Checkpoint 0 is the starting level before any changes, and checkpoint 1 is after the first change. If no level is reached twice, return [-1, -1].
Constraints
changes contains from 0 to 20,000 integersEach change is an integer from -10,000 to 10,000Checkpoint 0 is the level before any change is applied
Function signature
def first_revisited_level(changes):