Fast, Easy & Short C++ Solution
```\n\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int ans(1), k(0);\n        s += \'*\';\n        for (int i = 0; i + 1 < s.length(); ++i)
```\n\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int ans(1), k(0);\n        s += \'*\';\n        for (int i = 0; i + 1 < s.length(); ++i)\n            if (s[i] != s[i + 1]) {\n                ans = max(ans, i + 1 - k);\n                k = i + 1;\n            }\n        return ans;\n    }\n};
[]