1446. Consecutive Characters
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nsimple approach\n# Comp
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nsimple approach\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int count=1,maxcount=1;\n        int n=s.length();\n        for(int i=0; i<n-1; i++){\n           if(s[i]==s[i+1]){\n            count++;\n           }\n           else{\n            count=1;\n           }\n           maxcount=max(maxcount,count);\n        }\n        return maxcount;\n    }\n};\n```
['C++']