Skip to content
← Back to the archive

10 September 2026 · Advanced track

Signal Burst Energy

Advanced Lists Numbers

Find the highest-energy contiguous burst within a stream of signal readings.

A sensor records a stream of signal readings in order. Each reading can be positive (a burst of energy) or negative (a dip). Consider every possible contiguous stretch of one or more consecutive readings, and add up the readings within each stretch. Return the highest total any single contiguous stretch can reach. A stretch must contain at least one reading - it is never empty - so if every reading is negative, the answer is the least negative single reading.

Constraints

  • readings has between 1 and 1000 entries
  • each reading is a whole number between -1000000 and 1000000

Function signature

def max_burst_energy(readings):

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+.