Determine if String Halves Are Alike

给一个string, 问二分后, 是不是包含相同数目的元音字符.

class Solution {
    public boolean halvesAreAlike(String s) {
        s = s.toLowerCase();
        Set<Character> set = new HashSet<>();
        set.add('a');
        set.add('e');
        set.add('i');
        set.add('o');
        set.add('u');
        int left = 0;
        int right = 0;
        for(int i = 0; i < s.length() / 2; i++) {
            if(set.contains(s.charAt(i)))
                left++;
        }
        for(int i = s.length() / 2; i < s.length(); i++) {
            if(set.contains(s.charAt(i)))
                right++;
        }
        return left == right;
    }
}