Skip to content

Practice Valid Word

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3136
LeetCode Problem

Valid Word

Problem Statement

Given word, return whether it has at least three characters, contains only English letters or digits, and includes both a vowel and a consonant. Vowels are a, e, i, o, and u in either case; consonants are the other English letters. Digits do not count as vowels or consonants.

Source: Valid Word on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
word = "234Adas"
Output
true

# Example 2

Input
word = "b3"
Output
false

# Example 3

Input
word = "a3$e"
Output
false

Constraints

1 <= word.length <= 20
word consists of English uppercase and lowercase letters, digits, '@', '#', and '$'.

Related LeetCode Problems

Practice more problems similar to Valid Word.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.