def solution(L, x):
    counter = 0
    for i in L:
        if x >= i:
            counter += 1
        else:
            L.insert(counter, x)
            break
    else:
        L.append(x)
    return L

f318da014a5ac5438d7eeb23ad5dac72e858d61c
<mask token>

def solution(L, x):
    counter = 0
    for i in L:
        if x >= i:
            counter += 1
        else:
            L.insert(counter, x)
            break
    else:
        L.append(x)
    return L
