package com.fishercoder.solutions;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * 1119. Remove Vowels from a String
 *
 * Given a string S, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the new string.
 *
 * Example 1:
 * Input: "leetcodeisacommunityforcoders"
 * Output: "ltcdscmmntyfrcdrs"
 *
 * Example 2:
 * Input: "aeiou"
 * Output: ""
 *
 * Note:
 * S consists of lowercase English letters only.
 * 1 <= S.length <= 1000
 * */
public class _1119 {
    public static class Solution1 {
        public String removeVowels(String S) {
            Set<Character> vowels = new HashSet<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));
            StringBuilder stringBuilder = new StringBuilder();
            for (char c : S.toCharArray()) {
                if (!vowels.contains(c)) {
                    stringBuilder.append(c);
                }
            }
            return stringBuilder.toString();
        }
    }

    public static class Solution2 {
        public String removeVowels(String S) {
            return S.replaceAll("[aeiou]", "");
        }
    }
}

@@ -107,386 +107,8 @@
 t;%0A%0A
-/**%0A * 1119. Remove Vowels from a String%0A *%0A * Given a string S, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the new string.%0A *%0A * Example 1:%0A * Input: %22leetcodeisacommunityforcoders%22%0A * Output: %22ltcdscmmntyfrcdrs%22%0A *%0A * Example 2:%0A * Input: %22aeiou%22%0A * Output: %22%22%0A *%0A * Note:%0A * S consists of lowercase English letters only.%0A * 1 %3C= S.length %3C= 1000%0A * */%0A
 publ

refactor 1119