The Full Counting Sort

  • + 1 comment

    Nice solution!

    A more concise (but perhaps less clear?) Python 3 translation might be:

    from collections import defaultdict
    n, A = int(input()), defaultdict(list)
    for i in range(n):
        ind, str = input().split()
        A[int(ind)].append('-' if i < n/2 else str)
    print(*map(' '.join, A.values()))