Leetcode Problem 1119. Remove Vowels from a String

1119. Remove Vowels from a String

Leetcode Solutions

Iterative Approach with String Builder

  1. Initialize a StringBuilder to build the result string without vowels.
  2. Iterate over each character in the input string.
  3. Check if the current character is not a vowel (not 'a', 'e', 'i', 'o', or 'u').
  4. If it is not a vowel, append it to the StringBuilder.
  5. After the iteration, convert the StringBuilder to a string and return it.
UML Thumbnail

Using Regular Expressions

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Code Diffs Compare
Full Screen
Copy Answer Code
Loading...