Please solve the programming task below using a self-contained code snippet in a markdown code block.

Write a method to compute all permutations of a string whose characters are not necessarily unique. The list of permutations should not have duplicates.
Please complete the following python code precisely:
```python
class Solution:
    def permutation(self, S: str) -> List[str]:
```