Fix build issues due to count (#5725)

* Fix build issues due to count

* Update check_anagrams.py
This commit is contained in:
Rohan R Bharadwaj 2021-11-01 03:26:33 +05:30 committed by GitHub
parent 94f38dd88c
commit 99cf2cc1c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
wiki: https://en.wikipedia.org/wiki/Anagram
"""
from collections import defaultdict
from typing import DefaultDict
def check_anagrams(first_str: str, second_str: str) -> bool:
@ -29,7 +30,7 @@ def check_anagrams(first_str: str, second_str: str) -> bool:
return False
# Default values for count should be 0
count = defaultdict(int)
count: DefaultDict[str, int] = defaultdict(int)
# For each character in input strings,
# increment count in the corresponding