I am trying to do the circular left shift of an array by n positions using only a single 1D array. I can do it in two arrays, but I haven\'t figured out how to do it using o
Maybe an old post.. but here you are my solution (where A obviously is the array and K the number of positions).
A
K
public int[] solution(int[] A, int K){ int[] result = new int[A.length]; for (int i = 0; i