Simple java solution
class Solution {\n\n    public int maxPower(String s) {\n        if(s.length()==1)\n            return 1;\n        int i,j=0,k=0;\n        for(i=0;i<s.length()-
class Solution {\n\n    public int maxPower(String s) {\n        if(s.length()==1)\n            return 1;\n        int i,j=0,k=0;\n        for(i=0;i<s.length()-1;i++)\n        {\n            if(s.charAt(i)==s.charAt(i+1))\n                j++;\n            else\n            {\n                j++;\n                k=Math.max(j,k);\n                j=0;\n            }\n        }\n        j++;\n        k=Math.max(j,k);\n        return k;\n    }\n}
[]