Easy to understand
\n# Code\n\nclass Solution {\n    public int maxPower(String s) {\n        // if (s.length()==1) {\n        //     return 1;\n        // }\n        int current=
\n# Code\n```\nclass Solution {\n    public int maxPower(String s) {\n        // if (s.length()==1) {\n        //     return 1;\n        // }\n        int current=1;\n        int max=1;\n        for (int i=1;i<s.length();i++) {\n            if (s.charAt(i-1)!=s.charAt(i)) {\n                current=1;\n            }\n            else {\n                current+=1;\n            }\n            max=Math.max(current,max);\n            // if (max<current) {\n            //     max=current;\n            // }\n        }\n        return max;\n    }\n}\n```
['Java']