• + 2 comments

    Very similar to my code. I took the modulus of d but it isn't really necessary because the slice method does it automatically.

    n, d = map(int, input().strip().split())
    arr = list(map(int, input().strip().split()))
    
    d %= n
    print(*(arr[d:] + arr[:d]))