I have a problem I need to solve efficiently.
PROBLEM: I have a 1 collection of integers of length(n). There could be duplicates. I want to get all the possible combinations of those integers. The result is not a fixed length.
ie.
Given the collection of integers: [1,2,2,3]
The expected output should be: [1] [1,2] [1,3] [1,2,2] [1,2,2,3] [1,2,3] [2,2] [2,3] [2,2,3]
How to do this in c#, I would prefer a linq version, but other solutions are welcome.
Thanks