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 6718ddb commit 8ff17f3Copy full SHA for 8ff17f3
my-submissions/e1160.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def countCharacters(self, words: List[str], chars: str) -> int:
3
+ chars = Counter(chars)
4
+
5
+ output = 0
6
+ for word in words :
7
+ wordCnt = Counter(word)
8
+ if all(wordCnt[x] <= chars[x] for x in wordCnt) :
9
+ output += len(word)
10
11
+ return output
0 commit comments