private int a(int[] arr, int startIndex, int lastValue, int count) { if (startIndex >= arr.length) { ...