Python ✅✅✅ || Faster than 99.60% || Memory Beats 97.63%
Code\n\nclass Solution:\n    def maxPower(self, s):\n        cnt = 0\n        m = 0\n        for i in range(1, len(s)):\n            if (s[i-1] == s[i]): \n    
# Code\n```\nclass Solution:\n    def maxPower(self, s):\n        cnt = 0\n        m = 0\n        for i in range(1, len(s)):\n            if (s[i-1] == s[i]): \n                cnt += 1\n                m = max(cnt, m)\n            else: cnt = 0\n        return m + 1\n```\n![image.png](https://assets.leetcode.com/users/images/6c285c86-bf64-44be-8c02-519334d6dbdd_1671072367.0797808.png)\n![image.png](https://assets.leetcode.com/users/images/2b36c6e8-594a-49d7-8876-1ccd2b9f2e89_1671072410.3246603.png)\n
['Python3']