• + 0 comments

    I have written this using simple basics if you know best way to solve pls comment below : )

    def rotateLeft(d, arr):
        dro=list(arr[i] for i in range(d))
        for i in dro:
            arr.remove(i)
        x=arr+dro
        print(*x)
    if __name__ == '__main__':
        first_multiple_input = input().rstrip().split()
        n = int(first_multiple_input[0])
        d = int(first_multiple_input[1])
        arr = list(map(int, input().rstrip().split()))
        rotateLeft(d, arr)