Incrementing specified list values, with "catch-up" I completed a coding challenge recently in which my function was to be given two parameters: N, the number of counters to be used (numbered 1 through N) - and A, an array of integers. Iterating through the array A, when the index of a counter occurs, that counter is incremented by 1. When an index of N+1 occurs, all of the counters are reset to the maximum counter at that point.

def solution(N, A):
    li = [0] * N
    #print('A is %s' % A)
    #print('N is %s' % N)
    max_val = 0

    for i in A:
        i = i-1
        #print('i is %s' % i)
        #print('li is %s' % li)
        if i == N:
            #print('  in if')
            li = [max_val] * N
        else:
            #print('  in else')
            li[i] = li[i] + 1
            if li[i] &gt; max_val:
                max_val = li[i]

    return li


[Using Python 3.6]
(See related question.)
li is the name of your list of counters. The fact they are counters matters more than the fact it's a list, so, I'd call it counters.
I like the clever way you updated all elements in the counters list by creating a new one, but it may be slower than looping through the list and changing all elements in place. It'll also use twice as much memory (before the old one is GC'ed).
Your previous version didn't update max_val. This was fixed since this was originally posted.