xxxxxxxxxx
# math.comb() does same thing
# fatorial
def fato(value: int):
if value > 1:
return value * fato(value - 1)
else:
return 1
# x choose y
def nCi(value: int, comb: int) -> int:
if comb > value or comb < 0:
return 0
if comb == value:
return 1
result = 0
result = fato(value) / (fato(comb) * fato(value - comb))
return result