Python O(n) by linear scan. [w/ Comment]
Python O(n) by linear scan.\n\n---\n\n\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        \n        # the minimum value for consecutive is 1\n   
Python O(n) by linear scan.\n\n---\n\n```\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        \n        # the minimum value for consecutive is 1\n        local_max, global_max = 1, 1\n        \n        # dummy char for initialization\n        prev = \'#\'\n        for char in s:\n            \n            if char == prev:\n                \n                # keeps consecutive, update local max\n                local_max += 1\n                \n                # update global max length with latest one\n                global_max = max( global_max, local_max )\n                \n            else:\n                \n                # lastest consective chars stops, reset local max\n                local_max = 1\n            \n                # update previous char as current char for next iteration\n                prev = char\n        \n        \n        return global_max\n```
['String', 'Iterator', 'Python', 'Python3']