Hello , @StefanPochmann
Thank you for your nice solutions.
But when I write like follow , the rank in output is with VARCHAR type but not numeric type. can you tell me what causes that ?

select
score,
case
when @prev = score then @rank
when (@prev := score) OR 1 then @rank:=@rank+1
end as rank
from
scores,
(select @prev:=NULL, @rank:=0) init
order by score desc;

My solutions is not very good, I think, but it exactly runs faster in 940ms. Hoping it can help you and want any comments.

# Write your MySQL query statement below
SELECT main.Score, c.Rank
FROM Scores main, (
SELECT b.Score AS Score, SUM(a.Score > b.Score) + 1 AS Rank
FROM (
SELECT DISTINCT Score
FROM Scores
) AS a,
(
SELECT DISTINCT Score
FROM Scores
) AS b
GROUP BY b.Score
) AS c
WHERE main.Score = c.Score
ORDER BY main.Score
DESC

I had a very very similar idea as yours, only differs in the line
(@prevScore := Score) is not null

Could someone kindly explain to me what's happening in this line?
I know that if is not null is not here, we would have trouble finding the correct answer then the Score equal to zero and there's only one row. But why adding is not null solve this problem?

@ninikitten Thanks for your solution, I've run your code and found out that the Rank column turns out to be Strings rather than Int, have you met the same problem?

The result is as following:
{"headers": ["Score", "Rank"], "values": [[4.00, "1"], [4.00, "1"], [3.85, "2"], [3.65, "3"], [3.65, "3"], [3.50, "4"]]}