I want to group them in all possible ways.
For example: If we have 5 stones, we will have 7 different ways to group them.
X X X X X
XX X X X
XXX X X
XXX XX
XX XX X
XXXX X
XXXXX
I've been trying to get the algorithm out all day but I can not get it, do you have any idea how to do this?
Thanks