How can I find the permutations of k in a given length?
For example:
The word cat has 3 letters: How can I find all the permutations of 2 in the
cat
What's wrong with the recursive solution and passing an extra parameter (depth) so that the recursive function returns immediately for depth > n.