• + 5 comments

    Solution in Python:

    first = input().strip().split(" ")
    list_length = int(first[0])
    rotation = int(first[1])
    input_list = input().split(" ")
    
    for i in range(rotation):
        input_list.append(input_list.pop(0))
    
    for i in input_list:
        print(i,end=" ")