constructor(values) {
        this._values = values;
        this._isValid = false;
        this._validEndIndex = -1;
        this._prefixSum = [];
        this._indexBySum = [];
    }
{@link getIndexOf} has an amortized runtime complexity of O(1).

({@link PrefixSumComputer.getIndexOf} is just  O(log n))