int (int @NotNull [] values, int start, int end) { int min = Integer.MAX_VALUE; int minIndex = start; for (int i = start; i < end; i++) { int value = values[i]; if (value < min) { min = value; minIndex = i; } } return minIndex; }