from typing import Counter


def getRepeatedList(mapping_argmat, score_mat_size):
    """
    Count the numbers in the mapping dictionary and create lists that contain
    repeated indices to be used for creating the repeated affinity matrix for
    fusing the affinity values.
    """
    count_dict = dict(Counter(mapping_argmat))
    repeat_list = []
    for k in range(score_mat_size):
        if k in count_dict:
            repeat_list.append(count_dict[k])
        else:
            repeat_list.append(0)
    return repeat_list