Skip to content

Solve issue #1876#2684

Open
Smithech wants to merge 1 commit intohackdartstorm:mainfrom
Smithech:issue-1876-smithech
Open

Solve issue #1876#2684
Smithech wants to merge 1 commit intohackdartstorm:mainfrom
Smithech:issue-1876-smithech

Conversation

@Smithech
Copy link
Copy Markdown

Solve “Substrings of Size Three with Distinct Characters” (#2666)

Add def good_substrings(s: str) -> int

  • The good_substrings function iterates through a string and counts all substrings of size 3 with distinct characters.
  • Comments and a docstring are included to help beginners understand how it works.

Example: count_distinct_substrings("abcabc") returns 4.
Explanation: The good substrings are 'abc', 'bca', 'cab', 'abc'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant