[Python] Simple one pass - O(n) time O(1) memory
Simple O(n) time O(1) memory python\n\nBasically just have to remember the previous char, current \'same char\' sequence, and the best \'same char\' sequence se
Simple O(n) time O(1) memory python\n\nBasically just have to remember the previous char, current \'same char\' sequence, and the best \'same char\' sequence seen.\n\n```\n\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        if not s or len(s) == 0: return 0\n        prev, counter, best = None, 0, 1\n        for c in s:\n            if c == prev:\n                counter += 1\n                best = max(best, counter)\n            else:\n                counter = 1\n                prev = c\n        return best\n```
[]