Ways to Partition a Set — Solution & Editorial
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)
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)