C# Solution 👌
```\npublic class Solution {\n    public int MaxPower(string s) {\n            int n = s.Length;\n            int max = Int32.MinValue;\n            int count =
```\npublic class Solution {\n    public int MaxPower(string s) {\n            int n = s.Length;\n            int max = Int32.MinValue;\n            int count = 1;\n            for (int i = 0; i < n - 1; i++)\n            {\n                if (s[i] == s[i + 1])\n                {\n                    count++;\n                    max = Math.Max(max, count);\n                }\n                else \n                {\n                    count = 1;\n                }\n            }\n            if (max > count)\n                return max;\n            else\n                return count;\n    }\n}
['String', 'C#']