def combination(n: int, r: int) -> int:
    """
    Returns the combination i.e nCr of given
    n and r
    >>> combination(5,3)
    10
    """
    # If either n or r is 0, nCr = 1
    if n == 0 or r == 0:
        return 1

    # Initializing variables
    nFac = 1
    rFac = 1
    nrFac = 1

    # A single for loop to compute all three required values
    for i in range(1, n+1):
        nFac *= i
        if i == r:
            rFac = nFac
        if i == (n-r):
            nrFac = nFac

    return nFac//(rFac * nrFac)