From 920d20c8df256c7babf21fc7610807f3a99007be Mon Sep 17 00:00:00 2001 From: Renato Ramos Nascimento Date: Thu, 30 Sep 2021 12:12:57 -0300 Subject: [PATCH] add Count the number of consistent strings solution --- .../solution.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Algorithms/Easy/1684_CountTheNumberOfConsistentStrings/solution.py diff --git a/Algorithms/Easy/1684_CountTheNumberOfConsistentStrings/solution.py b/Algorithms/Easy/1684_CountTheNumberOfConsistentStrings/solution.py new file mode 100644 index 0000000..59181a3 --- /dev/null +++ b/Algorithms/Easy/1684_CountTheNumberOfConsistentStrings/solution.py @@ -0,0 +1,13 @@ +from typing import List + + +class Solution: + def countConsistentStrings(self, allowed: str, words: List[str]) -> int: + not_match=0 + for word in words: + for w in word: + if w not in allowed: + not_match+=1 + break + ans=len(words)-not_match + return ans \ No newline at end of file