Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    420 - Strong Password Checker\.

    Hard

    A password is considered strong if the below conditions are all met:

    • It has at least 6 characters and at most 20 characters.

    • It contains at least one lowercase letter, at least one uppercase letter, and at least one digit.

    • It does not contain three repeating characters in a row (i.e., <code>"B<ins> aaa </ins>bb0"</code> is weak, but <code>"B**<ins>aa</ins>**b<ins> a </ins>0"</code> is strong).

    Given a string password, return the minimum number of steps required to make password strong. if password is already strong, return 0.

    In one step, you can:

    • Insert one character to password,

    • Delete one character from password, or

    • Replace one character of password with another character.

    Example 1:

    Input: password = "a"

    Output: 5

    Example 2:

    Input: password = "aA1"

    Output: 3

    Example 3:

    Input: password = "1337C0d3"

    Output: 0

    Constraints:

    • 1 &lt;= password.length &lt;= 50

    • password consists of letters, digits, dot '.' or exclamation mark '!'.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer strongPasswordChecker(String s)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait