JuniorString
Valid Word
A word is considered valid if:
- It contains a minimum of 3 characters.
- It contains only digits (
0-9) and English letters, both uppercase and lowercase. - It includes at least one vowel.
- It includes at least one consonant.
You are given a string word.
Return true if word is valid; otherwise, return false.
Notes:
'a','e','i','o','u', and their uppercase forms are vowels.- A consonant is an English letter that is not a vowel.
Example 1
Input
word = "234Adas"Output
trueThis word satisfies all the conditions.
Example 2
Input
word = "b3"Output
falseThe length of this word is fewer than 3, and it does not have a vowel.
Constraints
- 1 <= word.length <= 20
- word consists of English uppercase and lowercase letters, digits, '@', '#', and '$'.