Join Regular Classroom : Visit ClassroomTech

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