10 September 2026 · Advanced track
Signal Burst Energy
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 entrieseach reading is a whole number between -1000000 and 1000000
Function signature
def max_burst_energy(readings):