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.
I did not understand your code, can you put it to me in simple terms?
also can you tell me why this code fails? (7 test cases failed)
n = int(input())
arr = map(int, input().split())
first_max, second_max = 0,0
for current in arr :
if current > first_max :
first_max, second_max = current, first_max
elif current > second_max :
current = second_max
print(second_max)
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 →
I did not understand your code, can you put it to me in simple terms? also can you tell me why this code fails? (7 test cases failed)