LeetCode Solutions/December 2021 LeetCoding Challenge/Consecutive Characters.java
<reponame>DevashishPathrabe/LeetCode<filename>LeetCode Solutions/December 2021 LeetCoding Challenge/Consecutive Characters.javaclass Solution {
    public int maxPower(String s) {
        int count = 1;
        int power = 1;
        for(int i=0; i<s.length() - 1; i++){
            if(s.charAt(i) == s.charAt(i+1)){
                count++;
            } else{
                count = 1;
            }
            power = Math.max(power, count);
        }
        return power;
    }
}