I have to generate all variations without repetitions made of digits 0 - 9.
Length of them could be from 1 to 10. I really don\'t know how to solve it, especially ho
Imagine you had a magical function - given an array of digits, it will return you the correct permutations.
How can you use that function to produce a new list of permutations with just one extra digit?
e.g.,
if i gave you a function called permute_three(char[3] digits)
, and i tell you that it only works for digits 0
, 1
, 2
, how can you write a function that can permute 0
, 1
, 2
, 3
, using the given permute_three
function?
...
once you solved that, what do you notice? can you generalize it?