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.
def rotation(a):
l=a[::-1]
for i in range(d):
r=l.pop()
l.insert(0,r)
return(l[::-1])
Hy my logic is corrct I have checked it in python compiler using custom input but i am unable to return the output in hackerrank compiler. help me out here
Left Rotation
You are viewing a single comment's thread. Return to all comments →
def rotation(a): l=a[::-1] for i in range(d): r=l.pop() l.insert(0,r) return(l[::-1])