You are viewing a single comment's thread. Return to all comments →
C# this is with basic knowledge
public static List rotLeft(List a, int d) {
int length=a.Count()-1; int[] newArr = new int[length+1]; for(int i = length;i>-1;i--){ if(i-d<0) { int j=i-d; newArr[length+1+j]=a[i]; } else { newArr[i-d]=a[i]; } } return newArr.ToList() ; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
C# this is with basic knowledge
public static List rotLeft(List a, int d) {
}