FunctionRacerProblemsRace

Binomial Coefficient

EasyMathPython, JavaScript, TypeScript

Return the number of ways to pick k items out of n different items when order does not matter (n choose k). Do not use math.comb.

Example 1

n 5
k 2
returns 10

10 ways.

Example 2

n 4
k 0
returns 1

Exactly one way: pick nothing.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems