Skip to the content

Did the fever go down?

Problem

You get the three temperatures someone was checked at during the day, in a list and in the order they were taken: morning, afternoon, night. Return true if the fever kept going down reading after reading, that is, if each temperature is lower than the one before it. With [102, 101, 100.5] you return true.

Staying the same does not count as going down: with [100, 100, 99] you return false, even though the last one is the lowest of the three. Three temperatures always arrive and they can have decimals.

Examples

  • Down both times

    [102, 101, 100.5] → true

  • Up in the afternoon

    [101, 102, 100] → false

  • Down by a hair

    [104, 103.9, 103.8] → true

Besides these, the challenge has hidden tests that are revealed when you submit your solution.

You start with this

Python

def went_down(temps):
    pass

JavaScript

function wentDown(temps) {
}
Solve this challenge

It opens in your browser, with the editor and the tests. It is free and you do not need an account to start.

More O(1) challenges

See all challenges →