We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
we go to the 3rd line
m=max(arr) #we put the maximum value of the array in the varriable m
while m in arr : #loop the array looking for the maximum value
arr.remove(m) #remove that maximum value
#repeat the loop until ther's no value equale to the old maximum value so ther's only the secon maximum who becom the maximum value
print(max(arr)) #the we print the actual max (the second )
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
ofc , so the 3 first line are generic
we go to the 3rd line m=max(arr) #we put the maximum value of the array in the varriable m