Skip to content

Practice Strong Password Checker II

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

Easy#2299
LeetCode Problem

Strong Password Checker II

Problem Statement

Return whether password has at least eight characters, contains a lowercase letter, an uppercase letter, a digit and a character from !@#$%^&*()-+, and has no pair of identical adjacent characters. Every condition must hold.

Source: Strong Password Checker II on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
password = "IloveLe3tcode!"
Output
true

# Example 2

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

# Example 3

Input
password = "1aB!"
Output
false

Constraints

1 <= password.length <= 100
password consists of letters, digits, and special characters: "!@#$%^&*()-+".

Related LeetCode Problems

Practice more problems similar to Strong Password Checker II.

Review your practice with PhantomCodeAI

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