Python  | 2 Pointer | O(n) time O(1) space | One Pass Solution
This problem is basically asking us to find the longest substring with a given condition - all the characters being the same.\n\nWe can use 2 pointer approach, 
This problem is basically asking us to find the longest substring with a given condition - all the characters being the same.\n\nWe can use 2 pointer approach,  this one is particularly suited for a straightforward approach using 2 pointers - one that will be "stuck" at the first new character we encounter, the other one advancing from there as long as we find chars with the same value.\n\nTalk is Useless, Let\'s see the code!:\n```\nclass Solution:\n    def maxPower(self, s: str) -> int:\n        i,j=0,0\n        ans=0\n        while(j<len(s)):\n            if s[i]==s[j]:\n                ans=max(ans,j+1-i)\n                j+=1\n            else:\n                i=j\n        return(ans)\n```
['Two Pointers', 'Python']