Easy c++ solution with comments
\nclass Solution {\npublic:\n    int maxPower(string s) {\n        //ans will store the final ans and now will store the current answer\n        int ans = INT_M
```\nclass Solution {\npublic:\n    int maxPower(string s) {\n        //ans will store the final ans and now will store the current answer\n        int ans = INT_MIN, now = 1;\n        \n        for(int i = 0;i<s.length();i++){\n            //if the current char is the same as the next char then increase now\n            if(i+1<s.length()&&s[i]==s[i+1]){\n                now++;\n            }else{\n                //if the 2 consecutive characters are not same then update ans\n                ans = max(ans,now);\n                //assign 1 to now to store the count for the next consecutive chars\n                now = 1;            \n            }\n        }\n        //return ans as the final answer\n        return ans;\n    }\n};\n```
[]