Count Vowels

Easy~10 min

Given a string s, return the number of vowels in the string.

Vowels are a, e, i, o, u (both uppercase and lowercase should be counted).

Examples

Example 1
Input: s = "hello"
Output: 2
Explanation: The vowels are "e" and "o".
Example 2
Input: s = "AEIOU"
Output: 5
Explanation: All five characters are uppercase vowels.
Example 3
Input: s = "bcdfg"
Output: 0
Explanation: There are no vowels in the string.

Constraints

  • 0 <= s.length <= 10^5
  • s consists of English letters (uppercase and lowercase).
Code
Ctrl+EnterRun|Ctrl+⇧+EnterSubmit
Output

Run your code to see results

Use Cmd+Enter to run