diff --git a/E_1876_SubstringsofSizeThreewithDistinctCharacters.py b/E_1876_SubstringsofSizeThreewithDistinctCharacters.py new file mode 100644 index 0000000..de5ace4 --- /dev/null +++ b/E_1876_SubstringsofSizeThreewithDistinctCharacters.py @@ -0,0 +1,8 @@ +class Solution: + def countGoodSubstrings(self, s: str) -> int: + counter=0 + for i in range(len(s)-2): + if len(s[i:i+3]) == len(set(s[i:i+3])): + counter = counter+1 + + return counter \ No newline at end of file