Company: Microsoft_6Aug
Difficulty: medium
Maximum Operations on String Problem Description You are given a string s of lowercase English letters. The following operation can be performed any number of times: Choose three consecutive characters s[i] , s[i+1] and s[i+2] , where 1 <= i <= |s| - 2 (1-based indexing), such that s[i] = s[i+1] and s[i+1] != s[i+2] . Replace s[i+2] with s[i] . The string changes after every operation, and later operations are chosen on the changed string. The order in which operations are performed is up to you. Find the maximum number of operations that can be applied to s . Function Description Complete the function getMaximumOperations in the editor. getMaximumOperations has the following parameter: string s : the string to transform It returns a 64-bit integer: the maximum number of times the operation can be applied. Input Format Read from standard input. s The only line contains the string s . Output Format Print a single integer: the maximum number of operations. Constraints 3 <= |s| &