Find the Runner-Up Score! Hackerrank
For Explanation Watch video:
Sample Input 0
5
2 3 6 6 5
Sample Output 0
5
Code:
if __name__ == '__main__': n = int(input()) arr = map(int, input().split()) print(sorted(list(set(arr)))[-2])
Sample Input 0
5
2 3 6 6 5
Sample Output 0
5
Code:
if __name__ == '__main__': n = int(input()) arr = map(int, input().split()) print(sorted(list(set(arr)))[-2])
Comments
Post a Comment