Strong Password Checker II

Easy

Description

A password is strong if: length >= 8, contains lowercase, uppercase, digit, special character, and no two adjacent characters are the same. Return true or false.

Examples

Input:password = "IloveLe3tcode!"
Output:true
Explanation:

The password meets every requirement: it is at least 8 characters long, includes lowercase, uppercase, a digit, and a special character, and has no adjacent duplicates. The exact output is true.

Input:password = "Me+You--IsMyDream"
Output:false
Explanation:

Missing a digit. The password has uppercase, lowercase, and special characters but no numeric digit.

Input:password = "1aB!"
Output:false
Explanation:

Too short. The password has only 4 characters but requires a minimum length of 8.

Constraints

  • 1 ≤ password.length ≤ 100

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!