• + 0 comments

    Python

    n, d = map(int,input().split(' '))
    arr = list(map(int,input().split(' ')))
    # spliting array into two parts
    y = arr[:d:]
    z = arr[d::]
    # extending second list with first list instead of using for loop.
    z.extend(y)
    #unpacking list to string items
    print(*z)