I was looking for a function that returns the partitions of an integer. I found almost what I wanted in this question:
Print all unique integer partitions given an integer as input
This function prints the partitions of an integer. But how can I change it in order to actually store and return all the partitions (maybe in a List)?
I'm aware that Java has the combinatoricslib
. Is there something similar in C#? If not, how could I make that function return all possible partitions?