def countingsort(list_a):
    """
    Sort the list list_a. list_a has to be a list of integers.

    Every element of the list list_a has to be non-negative.

    Parameters
    ----------
    list_a :
        Should get sorted

    Returns
    -------
    list
        Sorted list with same elements as list_a.
    """
    if len(list_a) == 0:
        return []

    list_c = [0] * (max(list_a)+1)
    list_b = [""] * len(list_a)

    # Count the number of elements
    for el in list_a:
        list_c[el] += 1
    # Now list_c[i] contains how often i is in list_a

    for index in range(1, len(list_c)):
        list_c[index] += list_c[index-1]

    for el in list_a[::-1]:
        list_b[list_c[el]-1] = el
        list_c[el] -= 1

    return list_b