From 99cf2cc1c5a83585625a26b6f267ac8f25affdc7 Mon Sep 17 00:00:00 2001 From: Rohan R Bharadwaj Date: Mon, 1 Nov 2021 03:26:33 +0530 Subject: [PATCH] Fix build issues due to count (#5725) * Fix build issues due to count * Update check_anagrams.py --- strings/check_anagrams.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strings/check_anagrams.py b/strings/check_anagrams.py index 938bf4c2a..f652e2294 100644 --- a/strings/check_anagrams.py +++ b/strings/check_anagrams.py @@ -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