def other(si, ti):
    """
    Retrieves the "other" index that is not equal to the stack index or target stack index.

    Parameters
    ----------
    si : int
        The stack index that would be removed from.
    ti : int
        The target stack index that would be added to.

    Returns
    -------
    int
        The "other" index in the list [0, 1, 2] that equates to the stack index that is unused (not stack index or target stack index).
    """
    other = [0, 1, 2]
    del other[other.index(ti)]
    del other[other.index(si)]
    return other[0]