Skip to main content

Practice · 2 of 5

Choose the Team

CHALLENGE
Difficulty: intermediate+25 XP

**Description:** Count the ways to choose k people from n (order does not matter). Compute C(n, k) exactly; the answer fits in 64 bits for these constraints (1 <= k <= n <= 40). **Input:** One line: n k (1 <= k <= n <= 40). **Output:** One integer — C(n, k). **Example:** 5 2 -> 10.

Back to lesson: Practice: Recursion Problem Set