CoolFace
Datasetpublic

TheRealSamuel/LeetCodeProblem

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes572downloads
1{2    "id": 2391,3    "name": "strong_password_checker_ii",4    "difficulty": "Easy",5    "link": "https://leetcode.com/problems/strong-password-checker-ii/",6    "date": "2022-05-28 00:00:00",7    "task_description": "A password is said to be **strong** if it satisfies all the following criteria: It has at least `8` characters. It contains at least **one lowercase** letter. It contains at least **one uppercase** letter. It contains at least **one digit**. It contains at least **one special character**. The special characters are the characters in the following string: `\"!@#$%^&*()-+\"`. It does **not** contain `2` of the same character in adjacent positions (i.e., `\"aab\"` violates this condition, but `\"aba\"` does not). Given a string `password`, return `true`_ if it is a **strong** password_. Otherwise, return `false`. **Example 1:** ``` **Input:** password = \"IloveLe3tcode!\" **Output:** true **Explanation:** The password meets all the requirements. Therefore, we return true. ``` **Example 2:** ``` **Input:** password = \"Me+You--IsMyDream\" **Output:** false **Explanation:** The password does not contain a digit and also contains 2 of the same character in adjacent positions. Therefore, we return false. ``` **Example 3:** ``` **Input:** password = \"1aB!\" **Output:** false **Explanation:** The password does not meet the length requirement. Therefore, we return false. ``` **Constraints:** `1 <= password.length <= 100` `password` consists of letters, digits, and special characters: `\"!@#$%^&*()-+\"`.",8    "public_test_cases": [9        {10            "label": "Example 1",11            "input": "password = \"IloveLe3tcode!\"",12            "output": "true "13        },14        {15            "label": "Example 2",16            "input": "password = \"Me+You--IsMyDream\"",17            "output": "false "18        },19        {20            "label": "Example 3",21            "input": "password = \"1aB!\"",22            "output": "false "23        }24    ],25    "private_test_cases": [26        {27            "input": "knU$3lrn",28            "output": true29        },30        {31            "input": "2OW^kXr1",32            "output": true33        },34        {35            "input": "J&h5I2k@",36            "output": true37        },38        {39            "input": "Wh*2r)@G",40            "output": true41        },42        {43            "input": "Wby&f5Kf",44            "output": true45        }46    ],47    "haskell_template": "strongPasswordCheckerII :: String -> Bool\nstrongPasswordCheckerII password ",48    "ocaml_template": "let strongPasswordCheckerII (password: string) : bool =  ",49    "scala_template": "def strongPasswordCheckerII(password: String): Boolean = { \n    \n}",50    "java_template": "class Solution {\n    public boolean strongPasswordCheckerII(String password) {\n        \n    }\n}",51    "python_template": "class Solution(object):\n    def strongPasswordCheckerII(self, password):\n        \"\"\"\n        :type password: str\n        :rtype: bool\n        \"\"\"\n        "52}