Created
June 25, 2020 04:58
-
-
Save Irene-123/4bf722316b11a58829f0767b6d280dc7 to your computer and use it in GitHub Desktop.
CodinGame Temperatures Puzzle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ```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