package leetcode;

/**
 * https://leetcode.com/problems/consecutive-characters/
 */
public class Problem1446 {
    public int maxPower(String s) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1446 prob = new Problem1446();
        System.out.println(prob.maxPower("leetcode")); // 2
        System.out.println(prob.maxPower("abbcccddddeeeeedcba")); // 5
        System.out.println(prob.maxPower("triplepillooooow")); // 5
        System.out.println(prob.maxPower("hooraaaaaaaaaaay")); // 11
        System.out.println(prob.maxPower("tourist")); // 1
    }
}

@@ -152,458 +152,301 @@
     
-// TODO%0A        return 0
+int answer = 1;%0A        int tmp = 1
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1446 prob = new Problem1446();%0A        System.out.println(prob.maxPower(%22leetcode%22)); // 2%0A        System.out.println(prob.maxPower(%22abbcccddddeeeeedcba%22)); // 5%0A        System.out.println(prob.maxPower(%22triplepillooooow%22)); // 5%0A        System.out.println(prob.maxPower(%22hooraaaaaaaaaaay%22)); // 11%0A        System.out.println(prob.maxPower(%22tourist%22)); // 1
+for (int i = 1; i %3C s.length(); i++) %7B%0A            if (s.charAt(i - 1) == s.charAt(i)) %7B%0A                tmp++;%0A            %7D else %7B%0A                tmp = 1;%0A            %7D%0A            answer = Math.max(answer, tmp);%0A        %7D%0A        return answer;
 %0A   

Solve problem 1446