Problems > A Row of Pascal's Triangle > Editorial

A Row of Pascal's Triangle — Solution & Editorial

Back to the Problem

Build multiplicatively: C(n,k) = C(n,k−1)·(n−k+1)/k. Exact big integers make the division trivial in Python; in C++ use modular inverses of k.

Complexity: O(N)