package leetcode;

/**
 * https://leetcode.com/problems/determine-if-string-halves-are-alike/
 */
public class Problem1704 {
    public boolean halvesAreAlike(String s) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1704 prob = new Problem1704();
        System.out.println(prob.halvesAreAlike("book")); // true
        System.out.println(prob.halvesAreAlike("textbook")); // true
        System.out.println(prob.halvesAreAlike("MerryChristmas")); // false
        System.out.println(prob.halvesAreAlike("AbCdEfGh")); // true
    }
}

@@ -176,414 +176,589 @@
     
-// TODO%0A        return false;
+int leftCount = 0;%0A        for (int i = 0; i %3C s.length() / 2; i++) %7B
 %0A    
-%7D%0A%0A
+  
     
-public static void main(String%5B%5D args) %7B%0A        Problem1704 prob = new Problem1704();%0A        System.out.println(prob.halvesAreAlike(%22book%22)); // true%0A        System.out.println(prob.halvesAreAlike(%22textbook%22)); // true%0A        System.out.println(prob.halvesAreAlike(%22MerryChristmas%22)); // false%0A        System.out.println(prob.halvesAreAlike(%22AbCdEfGh%22)); // true
+  if (isVowel(s.charAt(i))) %7B%0A                leftCount++;%0A            %7D%0A        %7D%0A        int rightCount = 0;%0A        for (int i = s.length() / 2; i %3C s.length(); i++) %7B%0A            if (isVowel(s.charAt(i))) %7B%0A                rightCount++;%0A            %7D%0A        %7D%0A        return leftCount == rightCount;%0A    %7D%0A%0A    private static boolean isVowel(char c) %7B%0A        return c == 'a' %7C%7C c == 'e' %7C%7C c == 'i' %7C%7C c == 'o' %7C%7C c == 'u' %7C%7C c == 'A' %7C%7C%0A            c == 'E' %7C%7C c == 'I' %7C%7C c == 'O' %7C%7C c == 'U';
 %0A   

Solve problem 1704