Trains the technique from
LeetCode 3136Valid WordThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A token reads token, made up of English letters in either case, digits, and the marks '@', '#' and '$'.
The token is well formed when all of these hold:
'a', 'e', 'i', 'o' or 'u' in either case;Return whether the token is well formed.
Example 1
Three characters, none of them a mark, with `a` as the vowel and `B` as the consonant. The digit is allowed and counts as neither.
Example 2
Long enough and free of marks, but every letter is a consonant, so there is no vowel.
Example 3
The mark in the middle is not allowed, whatever else the token holds.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def is_valid(token: str) -> bool:public boolean isValid(String token)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.