Challenge: Find minimum in Subarray
Finish writing the function indexOfMinimum, which takes an array and a
number startIndex, and returns the index of the smallest value that occurs
with index startIndex or greater. If this smallest value occurs more than once
in this range, then return the index of the leftmost occurrence within this
range.
Java Python C++ JS
class Solution {
public static int indexOfMinimum(int[] array, int startIndex) {
// Set initial values for minValue and minIndex,
// based on the leftmost entry in the subarray:
int minValue = array[startIndex];
int minIndex = startIndex;
// Loop over items starting with startIndex,
// updating minValue and minIndex as needed:
return minIndex;
}
}