Problem library

Leaderboard Rank

Easy
sortingarrays

The leaderboard uses *dense ranking*: the highest score is rank 1, players with equal scores share a rank, and the next lower score gets the next rank with no gaps.

Given everyone's scores and your score (which may or may not already be in the list), return the rank you would have.

Examples

Input: scores = [100,90,90,80], score = 90
Output: 2
Input: scores = [100,90,90,80], score = 85
Output: 3