Capita interview question

All permutations of a string