There are x digits and y boxes where y is between 1 and x inclusive. I have to print all the possible digits in boxes (combinations) in any order. For examples, if x = 5 and y = 2 we can have the following 4 combinations:1234 5123 4512 3451 2345Similarly if x = 5 and y = 3123 4 512 34 512 3 451 234 51 23 451 2 345if x = 5 and y = 5 then there is only 1 combination1 2 3 4 5Both x and y are variable and I can't figure out even a brute force way of doing this. I have tried using three nested for loops but have no luck. 
Stuck on a combinations algo question
algorithms