Problems > Ways to Partition a Set > Editorial

Ways to Partition a Set — Solution & Editorial

Back to the Problem

The Bell triangle: each row starts with the last element of the previous row, and each subsequent entry adds the entry above-left. B(N) is the first entry of row N.

Complexity: O(N2)