← 返回 capitalone 的题目列表Number of Substrings with Unique Characters
类型:online_judge
Given a string s consisting of lowercase letters, find the number of substrings of length 3 where all the characters are different.
Input: 'abcabcbb' Output: 4 Explanation: The substrings with all different characters are 'abc', 'bca', 'cab', 'abc'.
Input: 'aaabbc' Output: 0 Explanation: There are no substrings with different characters.
Constraints: The length of string s does not exceed 10^5.
Example
Input
abcabcbb