Temperatures puzzle discussion


#716

You complicate too much just append them to one array and do one pass of the values with checking for value. You have constrains for the input just init to value like 10000.

result = cur = 10000
for c in tmp:
    if abs(c) < cur:
        cur = abs(c)
        result = c

#717

wait, what?


#718

Yeap sorry didn’t read that.


#719

I have exactly the same problem with this.
Maybe it’s a bug so we can’t pass this test :slight_smile:

Edit: I’ve just figured it out after I replied to you XD


#720

This is the moment where I realize how handy C# is when you are coming from C++.
There is no need to worry about the case if there are no values delivered because a int is 0 per default. Not so in C++…