Java soln
\n# Time complexity: Constant time\n\n# Space complexity: Constant time\n\n# Code\n\nclass Solution {\n    public int maxPower(String s) {\n        int[] power 
\n# Time complexity: Constant time\n\n# Space complexity: Constant time\n\n# Code\n```\nclass Solution {\n    public int maxPower(String s) {\n        int[] power = new int[s.length()];\n        power[0] = 1;\n        int pow=1;\n        for (int i = 1; i < s.length(); i++) {\n            if(s.charAt(i) == s.charAt(i-1))\n                pow++;\n            else\n                pow =1;\n            power[i] = pow;                  \n        }\n            pow = Arrays.stream(power).max().getAsInt();\n            return pow;\n        \n    }\n}\n```
['Java']