Substrings of Size Three with Distinct Characters Problem
Substrings of Size Three with Distinct Characters Problem — ExecCode Easy DSA Practice
Solve the Substrings of Size Three with Distinct Characters problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given a string s, return the number of good substrings of length threein s. Your task is to a string is good if there are no repeated characters. Note that if there are multiple occurrences of the same substring, every occurrence should be counted. A substring is a contiguous sequence of characters in a string. Return the required answer exactly as shown in the examples.
Examples
Input {"s": "xyzzaz"}; Output 1. Input {"s": "aababcabc"}; Output 4
Constraints
1 <= s.length <= 100 s consists of lowercase English letters.
Practice Substrings of Size Three with Distinct Characters free on ExecCode. Browse DSA problems, topic map, and placement guides.