def invert_scores(input_ranking):
    """
    Function that given a ranking list, it corrects its relevance in preparation for dcg. For example,
    [1,1,2,3] --> [3,3,2,1]
    [1,2] --> [2,1]
    [1] --> [1]
    :param input_ranking ordered list with the ranking
    """
    max_value = max(input_ranking)
    relevance = []
    for i in input_ranking:
        if i == 0:
            relevance.append(i)
        else:
            relevance.append(max_value-i + 1)
    return relevance