Skip to content

Commit

Permalink
1876
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Feb 9, 2022
1 parent 56feb7e commit 9a5541d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions E_1876_SubstringsofSizeThreewithDistinctCharacters.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9a5541d

Please sign in to comment.