Skip to content

Commit fe23f1a

Browse files
authored
Update find-words-that-can-be-formed-by-characters.py
1 parent cdf5171 commit fe23f1a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/find-words-that-can-be-formed-by-characters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def countCharacters(self, words, chars):
1111
:type chars: str
1212
:rtype: int
1313
"""
14-
def check(word, chars, count2):
14+
def check(word, chars, count):
1515
if len(word) > len(chars):
1616
return False
17-
count1 = collections.Counter()
17+
curr_count = collections.Counter()
1818
for c in word:
19-
count1[c] += 1
20-
if c not in count2 or count2[c] < count1[c]:
19+
curr_count[c] += 1
20+
if c not in count or count[c] < curr_count[c]:
2121
return False
2222
return True
2323

0 commit comments

Comments
 (0)