string permutation example from http://introcs.cs.princeton.edu/java/23recursion/Permutations.java.html