My 683ms solution via self join


  • 0
    H

    select t1.Score, sum(1) as Rank from Scores t1,
    (select distinct score from Scores) as t2
    where t1.score<=t2.score group by t1.id order by rank;


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.