Beats 100% runtime simple approach cpp!!!
Intuition\n Describe your first thoughts on how to solve this problem. \nBrute-force\n# Approach\n Describe your approach to solving the problem. \njust using t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nBrute-force\n# Approach\n<!-- Describe your approach to solving the problem. -->\njust using the concept of max() in cpp , we update the value as long as the same char proceeds along the length and keep it updated in the longest length of occurrance of a char , once a new char comes we start the count from 1 again and follow the same \n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nonly one for loop so O(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int maxPower(string s) {\n        int max_length=0;\n        int c=1;\n        for(int i=1;i<s.length();i++){\n            if(s[i-1]==s[i]){\n                c++;\n                max_length=max(max_length,c);\n            }\n            else c=1;\n        }\n        if(max_length<c) max_length=c;\n        return max_length;\n    }\n};\n```
['C++']