num=int(input())
l1=[]
element=input()
l1=element.split()
t=max(l1)
count=0
for i in range(0,num):
if t==l1[i]:
count=count+1
l1.sort()
if count==1:
print(l1[num-2])
else:
print(l1[num-3])
HackerRank Problems Solutions in C Programming Language
Comments
Post a Comment