from typing import List


def all_but_i(a: List[int], i: int) -> int:
    """A utility function that takes the product of all elements in an array
    except for the element at index `i`.

    param a: The input list
    param i: The index of the element to exclude
    returns: The product of all of the elements in `a` except for `a[i]`
    """
    res = 1

    for j in range(len(a)):
        if j != i:
            res *= a[j]
    return res