How to generate all possible combinations of numbers with grouping
Hi, just trying to smash through the Friedman challenge and I have probably figured out most of it but I am not sure how to generate the number combinations that I need. These aren't the good ol' combinations because apart from the order, you can group the digits. eg. [6, 7, 4, 5] means not only [4, 5, 7, 6] but can be also: [45, 7, 6] or even [674, 5] and [67,45]. Essentially, any set of numbers without repetitions. If there's anything language specific, I am (trying to become) a Rubyist. Excuse the non-scientific wording. Let know your ideas. Many thanks y'all!