Posted on December 1, 2021December 1, 2021 Description Submission class Solution { public: int maxPower(string s) { int cnt = 0; char prev = s[0]; int ret = 0; for(char ch: s) { if(ch == prev) ++cnt; else { cnt = 1; } prev = ch; ret = max(ret, cnt); } return ret; } }; By Bill0412 Easy LeetCode