A string is good if there are no repeated characters. Given string s, return the number of good substrings of length exactly 3.
Slide a window of fixed size 3, check if all 3 characters are distinct.
- Iterate i from 0 to n-3.
- Extract s[i], s[i+1], s[i+2].
- If all three are distinct (s[i]!=s[i+1] && s[i+1]!=s[i+2] && s[i]!=s[i+2]): count++.
- Time Complexity: O(N)
- Space Complexity: O(1)