In this problem, when my code is this:

```
class Solution:
# @param strs, a list of strings
# @return a list of strings
def anagrams(self, strs):
dic = {}
s = []
for ele in strs:
setS = str(sorted(set(ele)))
if dic.has_key(setS):
dic[setS].append(ele)
else:
dic[setS] = [ele]
for x in dic.itervalues():
if len(x) >= 2:
s.extend(x)
return s
```

the answer is : wrong answer

but if I changed the line:`setS = str(sorted(set(ele)))`

to `setS = str(sorted(ele))`

It has been accepted. I don't understand why.