package leetcode;

/**
 * https://leetcode.com/problems/delete-characters-to-make-fancy-string/
 */
public class Problem1957 {
    public String makeFancyString(String s) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1957 prob = new Problem1957();
        System.out.println(prob.makeFancyString("leeetcode")); // leetcode
        System.out.println(prob.makeFancyString("aaabaaaa")); // aabaa
        System.out.println(prob.makeFancyString("aab")); // aab
    }
}

@@ -178,344 +178,468 @@
     
-// TODO%0A        return null
+StringBuilder answer = new StringBuilder();%0A        int i = 0
 ;%0A    
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1957 prob = new Problem1957();%0A        System.out.println(prob.makeFancyString(%22leeetcode%22)); // leetcode%0A        System.out.println(prob.makeFancyString(%22aaabaaaa%22)); // aabaa%0A        System.out.println(prob.makeFancyString(%22aab%22)); // aab
+while (i %3C s.length()) %7B%0A            int count = 0;%0A            char c = s.charAt(i);%0A            while (i %3C s.length() && c == s.charAt(i)) %7B%0A                count++;%0A                i++;%0A            %7D%0A            if (count %3E= 2) %7B%0A                answer.append(c).append(c);%0A            %7D else %7B%0A                answer.append(c);%0A            %7D%0A        %7D%0A        return answer.toString();
 %0A   

Solve problem 1957