Java || 2-pointer || beats 100% || 1ms || O(s.length())
\n    public int maxPower(String s) {\n\t\tint omax = 1, ptr1 = 0, ptr2 = 0, len = s.length();\n\t\twhile (ptr1 < len) {\n\n\t\t\twhile (ptr1 < len && s.charAt(
\n    public int maxPower(String s) {\n\t\tint omax = 1, ptr1 = 0, ptr2 = 0, len = s.length();\n\t\twhile (ptr1 < len) {\n\n\t\t\twhile (ptr1 < len && s.charAt(ptr1) == s.charAt(ptr2))\n\t\t\t\tptr1++;\n\n\t\t\tomax = Math.max(omax, ptr1 - ptr2);\n\t\t\tptr2 = ptr1;\n\t\t}\n\t\treturn omax;\n\t}\n
[]