Question 2 Solution | Second Largest Solution | Codewindow.in

//codewindow.in
//solution function in python
N=int(input())
Arr= list(map(int,input().split()))[ : N ]

print(*[sorted(list(set(Arr)))[-2] if len(set(Arr))> 1 else -1 ] )

Follow us

Also Checkout

Leave a Comment

Your email address will not be published. Required fields are marked *