Rank vs dense rank? What are the use cases of rank and dense rank?
Asked in the technical_round_1 stage. Implement the distinction algorithmically for a list of scores, where higher scores rank first. Equal scores receive the same rank. Competition rank leaves gaps after ties, while dense rank does not.
Implement rank_scores(scores), accepting a non-empty list of integers. Return a list of (rank, dense_rank) tuples in the original input order.
def rank_scores(scores):