You are viewing a single comment's thread. Return to all comments →
C++
vector<int> rotateLeft(int d, vector<int> arr) { int size=arr.size(); int i,j; i=0; for( i=0;i<d;i++){ j=0; int temp=arr[j]; for( j=0;j<size-1;j++){ arr[j]=arr[j+1]; } arr[j]=temp; } return arr; }
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 →
C++