Complete function to find permutations without repeating characters