Skip to content

Instantly share code, notes, and snippets.

@Irene-123
Created June 25, 2020 04:58
Show Gist options
  • Save Irene-123/4bf722316b11a58829f0767b6d280dc7 to your computer and use it in GitHub Desktop.
Save Irene-123/4bf722316b11a58829f0767b6d280dc7 to your computer and use it in GitHub Desktop.
CodinGame Temperatures Puzzle
```python3
import sys
import math
from functools import reduce
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = int(input())
if n==0:
print(0)
t=[]
for i in input().split():
t.append(int(i))
print(reduce(lambda x, y : x if abs(y) > abs(x) else(x if abs(x)==abs(y) and x>y else y ) , t))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment