simple string permutation exercise