easyString 0 views

Strong Password Checker II

A password is said to be strong if it satisfies all the following criteria: Given a string password, return true if it is a strong password.

A password is said to be strong if it satisfies all the following criteria:

Given a string password, return true if it is a strong password. Otherwise, return false.

Strong Password Checker II diagram

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: "!@#$%^&*()-+".

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.