A password is deemed strong if it satisfies all of the following criteria:
Its length is at least
It contains at least one lowercase letter, at least one uppercase letter, and at least one digit.
It does not contain three or more identical characters consecutively (e.g., "Baaabb0" is weak, but "Baaba0" is strong).
Given a string, password, determine the minimum number of steps needed to make password strong. If it is already strong, return
In a single step, you may perform exactly one of the following operations:
Insert one character into password.
Delete one character from password.
Replace one character in password with a different character.
Constraints:
password.length
password consists of letters, digits, dot '.', or exclamation mark '!'.
A password is deemed strong if it satisfies all of the following criteria:
Its length is at least
It contains at least one lowercase letter, at least one uppercase letter, and at least one digit.
It does not contain three or more identical characters consecutively (e.g., "Baaabb0" is weak, but "Baaba0" is strong).
Given a string, password, determine the minimum number of steps needed to make password strong. If it is already strong, return
In a single step, you may perform exactly one of the following operations:
Insert one character into password.
Delete one character from password.
Replace one character in password with a different character.
Constraints:
password.length
password consists of letters, digits, dot '.', or exclamation mark '!'.