A Row of Pascal's Triangle — Solution & Editorial
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)
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)