Let say we have the fallowing classes 'X','Y','Z', The result so I need will be like this
(X),(X,Y),(X,Z),(X,Y,Z),(Y),(Y,Z),(Z)
And if we have 'X','Y','Z','J', The result so I need will be like this
(X), (X,Y),(X,Z),(X,J), (Y), (Y,Z),(Y,J), (Z),(Z,J)
(X,Y,Z), (X,Y,Z,J), (Y,Z,J), (Z,J,X)
What algorithm do I need to accomplish this?