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.
z = len(r)
w = len(player)
low = r[z-1]
high = r[0]
score = list()
for x in range(0,w):
for y in range(0,z):
if (player[x] < low):
score.append(z+1)
break
if (player[x] >= high):
score.append(1)
break
if (player[x] >= r[y]):
score.append(y+1)
break
return(score)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
This times out on large ranked input > 100k
r = sorted(list(set(ranked)), reverse=True)