Company: Microsoft_6Aug
Difficulty: medium
Maximum Operations on String Problem Description Given a string `s` of lowercase English characters, the following operation can be performed any number of times: Choose three consecutive characters `s[i], s[i+1], s[i+2]` (0-based indexing) where `0 Find the maximum number of operations that can be applied to `s`. Examples Example 1: Input: s = "accept" Output: 3 Explanation: The following operations are performed (bold indicates changed character): Start at `i = 1` (0-based), substring "cce". `s[1] = 'c'`, `s[2] = 'c'`, `s[3] = 'e'`. Since `s[1] == s[2]` and `s[1] != s[3]`, replace `s[3]` with `s[1]`. The new string `s = "acccpt"`. Start at `i = 2` (0-based), substring "ccp". `s[2] = 'c'`, `s[3] = 'c'`, `s[4] = 'p'`. Since `s[2] == s[3]` and `s[2] != s[4]`, replace `s[4]` with `s[2]`. The new string `s = "acccct"`. Start at `i = 3` (0-based), substring "cct". `s[3] = 'c'`, `s[4] = 'c'`, `s[5] = 't'`. Since `s[3] == s[4]` and `s[3] != s[5]`, replace `s[5]` with `s[3]`. The new string `