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.
Python Method : Using bisect to find the insert point and also is the new rank. However, sorted array must be the ascending because of bisect. Thus, I first delete duplicated scores so that rank number can be corresponding to the len(ranked)-index, and then re-sort it. Next, use bisect_right to find the insert point. When you get the insert point, you need to plus one for correcting rank number (rarher than index value).
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
Python Method : Using bisect to find the insert point and also is the new rank. However, sorted array must be the ascending because of bisect. Thus, I first delete duplicated scores so that rank number can be corresponding to the
len(ranked)-index
, and then re-sort it. Next, use bisect_right to find the insert point. When you get the insert point, you need toplus one
for correcting rank number (rarher than index value).