I need to generate the combinations of numbers using ruby.
For Example :
arr = [1,2,3,4,5]
The constraint is, the combination number should include the number 5 and the length is minimum 3 or above. (i.e 125, 521, 1245 etc.. ). The above array elements (values 1 to 5) may occur one or two or more times in the combination number.
Try this: