3136. Valid Word
Description
A word is considered valid if:
- It contains a minimum of 3 characters.
- It contains only digits (0-9), and English letters (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 uppercases are vowels .- A consonant is an English letter that is not a vowel.
Example 1:
1 | Input: word = "234Adas" |
Example 2:
1 | Input: word = "b3" |
Example 3:
1 | Input: word = "a3$e" |
Constraints:
1 <= word.length <= 20
word
consists of English uppercase and lowercase letters, digits,'@'
,'#'
, and'$'
.
Hints/Notes
- N/A
Solution
Language: C++
1 | class Solution { |