static boolean isRotated(int[] array1, int[] array2) {
        int length = array2.length;
        for (int i =0; i<length; i++) {
            int tmp = array2[i];
            array2[i] = array2[i+1];
            array2[length-1] = tmp;
            if (isSame(array1, array2)) {
                return true;
            }
            length--;
        }
        return false;
    }