← back to unit
Medium
# searching medium
Second Lowest Temperature
The penguin colony reports each night's temperature, and scientists want the second coldest night. 🐧
You get a list of temps — at least two, all different. Print the second lowest, in one pass, no sorting.
Example:
Input: temps = [-4, -12, 3, -9]
Output: -9
-12 is the coldest night. Tracking the second-coldest alongside it, that turns out to be -9.
💡 need a hint?
srch-second-lowest-temp.py🔒 given lines are locked — write your code in between
loading...