def comb(N, k):
    """
    The number of combinations of N things taken k at a time.

    Parameters
    ----------
    N : int, array
        Number of things.
    k : int, array
        Number of elements taken.

    """
    if k > N or N < 0 or k < 0:
        return 0
    val = 1
    for j in range(min(k, N - k)):
        val = val * (N - j) / (j + 1)
    return val
