Solution to problem 24

- Produce all permutations then get the required
  nth permutation