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:
5Explanation:
Password 'a' needs 5 more chars to reach min length 6, plus uppercase and digit.
Input:
password = "1337C0d3"Output:
0Explanation:
Password '1337C0d3' already meets all requirements: 8 characters (within 6-20), has uppercase ('C'), lowercase ('d'), digits ('1','3','7','0'), and no 3 consecutive repeating characters.
Input:
password = "aaaaaaaaaaaaaaaaaaaaa"Output:
7Explanation:
The password exceeds maximum length, lacks uppercase and digit, and has repeating sequences. Multiple operations are needed.
Constraints
- •
1 ≤ password.length ≤ 50