Easy Solution O(N) time and O(1) space complexity
Steps - \n Keep a max and currentMax variable assigned to 1\n\t Assigned to 1 because the constraint says the length of string is 1 atleast, thus there would 1 
**Steps** - \n* Keep a max and currentMax variable assigned to 1\n\t* Assigned to 1 because the constraint says the length of string is 1 atleast, thus there would 1 result atleast\n* Iterate through the string to len - 1 comparing each char to the next one\n\t* If matches then increase the current max by 1\n\t* Else reset the current max to 1 which is the minimum value\n* After each check update the max to be the maximum out of the max and current max\n* return max as answer  \n\n**Time Complexity** - O(N)\n**Space Complexity** - O(1)\n```\n    public int maxPower(String s) {\n        // Set currMax and max as 1\n        // As for a string with one character 1 would be the answer\n        int currMax = 1;\n        int max = 1;\n        // Looping through the string checking each char with the one ahead of it\n        for(int i = 0; i < s.length() - 1; i++) {\n            char temp = s.charAt(i);\n        // If char are equal increase the current max by 1\n            if(temp == s.charAt(i + 1)) {\n                currMax++;\n            } else {\n        // If char don\'t match, reset the current max to 1\n                currMax = 1;\n            }\n        // After each check update the max to be the maximum\n        // out of current max and itself\n            max = Math.max(currMax, max);\n        }\n        // return max as answer\n        return max;\n    }\n```
['Java']