Description

A strong password has 6-20 chars, at least one lowercase, uppercase, and digit, no 3 consecutive repeating chars. Return minimum steps to make password strong.

Examples

Input:password = "a"
Output:5
Explanation:

Add 5 characters.

Input:password = "1337C0d3"
Output:0
Explanation:

Edge case returning zero.

Input:password = "aaaaaaaaaaaaaaaaaaaaa"
Output:7
Explanation:

The password exceeds maximum length, lacks uppercase and digit, and has repeating sequences. Multiple operations are needed.

Constraints

  • 1 ≤ password.length ≤ 50

Ready to solve this problem?

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