package leetcode;

/**
 * https://leetcode.com/problems/remove-palindromic-subsequences/
 */
public class Problem1332 {
    public int removePalindromeSub(String s) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1332 prob = new Problem1332();
        System.out.println(prob.removePalindromeSub("ababa")); // 1
        System.out.println(prob.removePalindromeSub("abb")); // 2
        System.out.println(prob.removePalindromeSub("baabb")); // 2
        System.out.println(prob.removePalindromeSub("")); // 0
    }
}

@@ -172,16 +172,31 @@
     
-// TODO%0A
+if (s.isEmpty()) %7B%0A    
     
@@ -217,366 +217,337 @@
     
+  
+  
 %7D
-%0A
 %0A    
-public static void main(String%5B%5D args) %7B%0A        Problem1332 prob = new Problem1332()
+    if (isPalindrome(s)) %7B%0A            return 1;%0A        %7D%0A        return 2
 ;%0A    
+%7D%0A%0A
     
-System.out.println(prob.removePalindromeSub(%22ababa%22)); // 1%0A        System.out.println(prob.removePalindromeSub(%22abb%22)); // 2%0A        System.out.println(prob.removePalindromeSub(%22baabb%22)); // 2%0A        System.out.println(prob.removePalindromeSub(%22%22)); // 0
+private static boolean isPalindrome(String s) %7B%0A        for (int i = 0, j = s.length() - 1; i %3C j; i++, j--) %7B%0A            if (s.charAt(i) != s.charAt(j)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;
 %0A   

Solve problem 1332