Calculate value of [ n * ( n - 1 ) * -- - * ( n - k + 1 ) ] / [ k * ( k - 1 ) * -- - * 1 ]
for ( let i = 0 ; i < k ; ++ i ) { res *= ( n - i ) ; res = Math . floor ( res / ( i + 1 ) ) ; } return res ; }