Fastest and Easiest java solution
Intuitioncompare current and next character if equal increment count else compare with the maxCount and return the maxCount.Approach
We need two variables, 1st
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
compare current and next character if equal increment count else compare with the maxCount and return the maxCount.

# Approach
<!-- Describe your approach to solving the problem. -->

1. We need two variables, 1st to count the count the number of equal characters and 2nd to store the maximum count
2. Iterate over the string, if current and next characters are equal increment count by 1 and compare it with maxCount else make count = 1
3. In case of s.charAt(i) == s.charAt(i+1), if maxCount is lower assign maxCount = count
4. Return maxCount

# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int maxPower(String s) {
        int count = 1; 
        int maxCount = 1;
        for(int i=0; i<s.length()-1; i++){
            if( s.charAt(i) == s.charAt(i+1)){
                count++;
                if(maxCount < count){
                    maxCount = count;
                }
            }else{
                count = 1;
            }
        }
        return maxCount;
    }
}
```
['Java']