def prefix_max(array: list, i: int) -> int:
    """Return index of maximum item in array[:i+1]"""
    if i >= 1:
        j = prefix_max(array, i-1)
        if array[i] < array[j]:
            return j
    return i