We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I had a similar approach. Mine is slower but doesnt use extra memory. Question: Your solution duplicates the memory since L is another list the same size of a ?
def rotateLeft(n ,d , a):
i = 0
while i < (d % n):
a.append(a.pop(0))
i += 1
print(*a)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
I had a similar approach. Mine is slower but doesnt use extra memory. Question: Your solution duplicates the memory since L is another list the same size of a ?