Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n =int(input())
- maxi = float("-inf")
- secondmax = float("-inf")
- count = 0
- if n!=0:
- lst = [int(i) for i in input().split()]
- while count<n:
- num = lst[count]
- if num>maxi:
- secondmax = maxi
- maxi = num
- elif num>secondmax and num!=maxi:
- secondmax=num
- count+=1
- if(secondmax!=float("-inf")):
- print(secondmax)
- else:
- print("-2147483648")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement