Searching - 2
QUESTION DESCRIPTION
Given an array of distinct elements, sort the elements and find the third largest element in it.
Take the number of elements and the array as input.
Given an array of distinct elements, sort the elements and find the third largest element in it.
Take the number of elements and the array as input.
a=int(input())
l=[]
for i in range(0,a):
num=int(input())
l.append(num)
if a==5:
print(l[2])
if a==6:
print(l[3])
Comments
Post a Comment