Write a method to compute all permutations of a string, whose characters are not neccesarily unique. The list of permutations should not have duplicates.