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.
res = []
for p in player:
low, high = 0, len(ranks)
while low < high:
mid = (low + high) // 2
if ranks[mid] > p:
low = mid + 1
else:
high = mid
res.append(low+1)
return res
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
` def climbingLeaderboard(ranked, player): ranks = list(set(ranked)) ranks.sort(reverse=True)