def binomial_coefficient_faster(n, r):
    """
    A faster way to calculate binomial coefficients 

    >>> binomial_coefficient_faster(10,5)
    252
    """
    if 0 <= r <= n:
        #initializing two variables as 1
        ntok = 1
        rtok = 1
        #we use the formula nCr = n!/(n-r)!r!
        for t in range(1, min(r, n - r) + 1):
            ntok *= n
            rtok *= t
            n -= 1
        return ntok // rtok
    else:
        return 0