Company: Autodesk_11april
Difficulty: medium
Distinct Consecutive Triplets Problem Description You're given a string `s` made up of lowercase English letters. Determine how many windows of three consecutive characters in `s` consist of three mutually different letters. Formally, count every index `i` for which `s[i]`, `s[i + 1]`, and `s[i + 2]` are all different from one another. Note: A fully optimized approach isn't required — any algorithm running in `O(s.length^2)` time or better will finish inside the time limit. Examples Example 1: Input: s = "abcdaaae" Output: 3 Explanation: At `i = 0`, the letters `s[0] = 'a'`, `s[1] = 'b'`, `s[2] = 'c'` are all different. At `i = 1`, the letters `s[1] = 'b'`, `s[2] = 'c'`, `s[3] = 'd'` are all different. At `i = 2`, the letters `s[2] = 'c'`, `s[3] = 'd'`, `s[4] = 'a'` are all different. At `i = 3`, the letters `s[3] = 'd'`, `s[4] = 'a'`, `s[5] = 'a'` are not all different since `s[4]` matches `s[5]`. At `i = 4`, the letters `s[4] = 'a'`, `s[5] = 'a'`, `s[6] = 'a'` are not all different,