You are viewing a single comment's thread. Return to all comments →
O(n+m) python solution
def climbingLeaderboard(ranked, player): r2 = sorted(set(ranked))[::-1] i, res = 0, [] for score in player[::-1]: while i < len(r2) and score < r2[i]: i += 1 res.append(i+1) return res[::-1]
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 →
O(n+m) python solution