def binomial_coefficient(n: int, k: int) -> int:
    """
    Returns the binomial coefficient

    Defined as: factorial(n) // (factorial(n - k) * factorial(k))

    :param n: The number of items
    :param k: The number of selected items
    :return: The number of ways to select k items from n options
    """
    if k > n:
        return 0
    k = min(k, n - k)  # take advantage of symmetry
    c = 1
    for i in range(k):
        c = (c * (n - i)) // (i + 1)
    return c