๐Ÿงญ Helm

The Hottest Reading

Stardate 55119.9 ยท UES Magnanimous

Briefing

The engineering display is meant to show the hottest of the eight coolant loops so that whoever is on watch knows where to look first. It shows loop one. It always shows loop one. Loop one is, in fact, the coldest, and has been for a month.

Commander Raghunathan found the routine returns the first reading rather than the largest. Lt. Skree has added that when there are no readings at all, the display shows "-1 degrees", which Skree describes as "a temperature that is also a lie". The Commander would like the real maximum, and nothing at all when there is nothing to measure.

Mission objectives

ARCHIE checks all five every time you run diagnostics.

  • โ€ขThe largest of several readings
  • โ€ขA single reading is the maximum
  • โ€ขThe maximum is not the first reading
  • โ€ขAll negative readings: the least negative wins
  • โ€ขNo readings at all: nothing, not a made-up number
Ask Commander Raghunathan for a hint

Keep the best-so-far as you walk the list, and start it from the first element, not from zero, or the all-negative case will bite. Python returns None for empty; Rust returns an Option, and .iter().max() already does exactly this.