package leetcode;

/**
 * https://leetcode.com/problems/make-the-string-great/
 */
public class Problem1544 {
    public String makeGood(String s) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1544 prob = new Problem1544();
        System.out.println(prob.makeGood("leEeetcode")); // "leetcode"
        System.out.println(prob.makeGood("abBAcC")); // ""
        System.out.println(prob.makeGood("s")); // "s"
    }
}

@@ -12,16 +12,41 @@
 tcode;%0A%0A
+import java.util.Stack;%0A%0A
 /**%0A * h
@@ -179,319 +179,1172 @@
     
-// TODO%0A        return null;%0A
+Stack%3CCharacter%3E stack = new Stack%3C%3E();%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A 
     
-%7D%0A%0A
+   
     
-public static void main(String%5B%5D args) %7B%0A        Problem1544 prob = new Problem1544();%0A        System.out.println(prob.makeGood(%22leEeetcode%22)); // %22leetcode%22%0A        System.out.println(prob.makeGood(%22abBAcC%22)); // %22%22%0A        System.out.println(prob.makeGood(%22s%22)); // %22s%22
+stack.push(s.charAt(i));%0A            if (stack.size() %3E= 2) %7B%0A                char a = stack.pop();%0A                char b = stack.pop();%0A                String aStr = %22%22 + a;%0A                String bStr = %22%22 + b;%0A                if ((!bStr.equals(bStr.toLowerCase()) %7C%7C !aStr.equals(bStr.toUpperCase())) &&%0A                    (!bStr.equals(bStr.toUpperCase()) %7C%7C !aStr.equals(bStr.toLowerCase()))) %7B%0A                    stack.push(b);%0A                    stack.push(a);%0A                %7D%0A            %7D%0A        %7D%0A        if (stack.size() %3E= 2) %7B%0A            char a = stack.pop();%0A            char b = stack.pop();%0A            String aStr = %22%22 + a;%0A            String bStr = %22%22 + b;%0A            if ((!bStr.equals(bStr.toLowerCase()) %7C%7C !aStr.equals(bStr.toUpperCase())) &&%0A                (!bStr.equals(bStr.toUpperCase()) %7C%7C !aStr.equals(bStr.toLowerCase()))) %7B%0A                stack.push(b);%0A                stack.push(a);%0A            %7D%0A        %7D%0A        String answer = %22%22;%0A        for (char c : stack) %7B%0A            answer += c;%0A        %7D%0A        return answer;
 %0A   

Solve problem 1544