Warm-ups · 15 of 24
Count vowels, consonants, digits and special characters
Return [vowels, consonants, digits, special]. Letters count in either case; special means anything that isn't a letter, digit or space.
Examples
Input s = "Hello World 123!"
Output [3, 7, 3, 1]
e, o, o are vowels; '!' is special; spaces don't count.
Input s = "#@ 9"
Output [0, 0, 1, 2]
📘 New to this? Indexing and walking through an array explains the idea in a few minutes.