You are viewing a single comment's thread. Return to all comments →
I thought my solution is neat.
but here are more neat solutions!
n, d = map(int, input().strip().split())
arr = [int(arr_t) for arr_t in input().strip().split()]
for _ in range(d):
Hey, I like your solution. A recommendation for the future is if you want to pop the first element, you should use a deque.
arr.pop(0) is O(N) while the deque version arr.popleft() is O(1)
Hey! Can you tell me how does *arr work?