TheRealSamuel/LeetCodeProblem
0561
1{2 "id": 3396,3 "name": "valid_word",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/valid-word/",6 "date": "2024-04-28 00:00:00",7 "task_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:** **Input:** word = \"234Adas\" **Output:** true **Explanation:** This word satisfies the conditions. **Example 2:** **Input:** word = \"b3\" **Output:** false **Explanation:** The length of this word is fewer than 3, and does not have a vowel. **Example 3:** **Input:** word = \"a3$e\" **Output:** false **Explanation:** This word contains a `'$'` character and does not have a consonant. **Constraints:** `1 <= word.length <= 20` `word` consists of English uppercase and lowercase letters, digits, `'@'`, `'#'`, and `'$'`.",8 "public_test_cases": [9 {10 "label": "Example 1",11 "input": "word = \"234Adas\"",12 "output": "true "13 },14 {15 "label": "Example 2",16 "input": "word = \"b3\"",17 "output": "false "18 },19 {20 "label": "Example 3",21 "input": "word = \"a3$e\"",22 "output": "false "23 }24 ],25 "private_test_cases": [26 {27 "input": "Gj#UP",28 "output": false29 },30 {31 "input": "ifhka@1pjwpS@Om7",32 "output": false33 },34 {35 "input": "btCM6QrVaYtHIZ#1Ueg",36 "output": false37 },38 {39 "input": "t@6YzUK600NKB9afj",40 "output": false41 },42 {43 "input": "cBo",44 "output": true45 },46 {47 "input": "2LevwlR",48 "output": true49 },50 {51 "input": "J28oLv3MqiGs",52 "output": true53 },54 {55 "input": "28oazDB37nk",56 "output": true57 },58 {59 "input": "zAXWzgNJmdk1BZitNF",60 "output": true61 },62 {63 "input": "mXCmEg7YQV",64 "output": true65 }66 ],67 "haskell_template": "isValid :: String -> Bool\nisValid word ",68 "ocaml_template": "let isValid (word: string) : bool = ",69 "scala_template": "def isValid(word: String): Boolean = { \n \n}",70 "java_template": "class Solution {\n public boolean isValid(String word) {\n \n }\n}",71 "python_template": "class Solution(object):\n def isValid(self, word):\n \"\"\"\n :type word: str\n :rtype: bool\n \"\"\"\n "72}