permutations of a string solution

visit shbcf.ru