Skip to content
← Back to the archive

16 September 2026 · Advanced track

Repeat Calibration Level

Advanced Lists Dictionaries Numbers

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 integers
  • Each change is an integer from -10,000 to 10,000
  • Checkpoint 0 is the level before any change is applied

Function signature

def first_revisited_level(changes):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.