Skip to content

Commit

Permalink
docs: add 2083
Browse files Browse the repository at this point in the history
  • Loading branch information
Aden-Q committed Jun 8, 2024
1 parent 6b762c1 commit b028386
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/2083.Substrings-That-Begin-and-End-With-the-Same-Letter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution:
def numberOfSubstrings(self, s: str) -> int:
counter = Counter()
prefix = ""
res = 0

for c in s:
counter[c] += 1
res += counter[c]

return res

0 comments on commit b028386

Please sign in to comment.