You are viewing a single comment's thread. Return to all comments →
Instead of rotating each element we can just cut the string upto that index and paste(append) it at the end of the string.
A solution for python would be
def leftrotation(a,d): return(a[d:]+a[:d])
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 →
Instead of rotating each element we can just cut the string upto that index and paste(append) it at the end of the string.
A solution for python would be