import math


def _comb(n, k):
    """Protected function to calculate nCk
    math.comb(n,k) was added in Python v3.8
    Hence, for backward compatibility with earlier versions
    """
    return math.factorial(n) / (math.factorial(n - k) * math.factorial(k))