simple and easy understanding c++ code
\ncpp []\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int n=s.length();\n        int c=1,d=1;\n        if(n==0){\n            return 0;\n  
\n```cpp []\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int n=s.length();\n        int c=1,d=1;\n        if(n==0){\n            return 0;\n        }\n        for(int i=1;i<n;i++){\n            if(s[i]==s[i-1]){\n                c++;\n            }\n            else{\n                d=max(d,c);\n                c=1;\n            }\n\n        }\n        d=max(c,d);\n        return d;\n        \n    }\n};\n```
['C++']