ROW_NUMBER() vs RANK() vs DENSE_RANK()
Asked in the Round 1 stage. Implement the behavior of these three ranking functions without using SQL.
Implement rank_scores(scores), where scores is a list of integers. Return a list sorted by score descending. Each output item must be [score, row_number, rank, dense_rank].
row_number increases for every item. rank assigns equal scores the same position and leaves gaps after ties. dense_rank assigns equal scores the same position without gaps.
def rank_scores(scores):