We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d5bba4 commit 9812192Copy full SHA for 9812192
zh-hans/string/anagrams.md
@@ -121,6 +121,28 @@ private:
121
122
**leetcode 上此题的 signature 已经更新,需要将 anagrams 按组输出,稍微麻烦一点点。**
123
124
+### Python lintcode
125
+
126
+```python
127
+class Solution:
128
+ # @param strs: A list of strings
129
+ # @return: A list of strings
130
131
+ def anagrams(self, strs):
132
+ strDict={}
133
+ result=[]
134
+ for string in strs:
135
+ if "".join(sorted(string)) not in strDict.keys():
136
+ strDict["".join(sorted(string))] = 1
137
+ else:
138
+ strDict["".join(sorted(string))] += 1
139
140
+ if strDict["".join(sorted(string))] >1:
141
+ result.append(string)
142
+ return result
143
+```
144
145
146
### C++ - lintcode
147
148
```c++
0 commit comments