Python O(n) current pointer approach
\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        current = 1\n        max_freq = 0\n        for i in range(1, len(s)):\n            if s[i] ==
```\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        current = 1\n        max_freq = 0\n        for i in range(1, len(s)):\n            if s[i] == s[i - 1]:\n                current += 1\n            else:\n                max_freq = max(current, max_freq)\n                current = 1\n        return max(max_freq, current)\n```\nFor more such questions: https://github.com/vanigupta20024/Programming-Challenges/tree/master
['Python', 'Python3']