xAaaa1 is not allowed, xAaxa1 is fine).
One edit inserts a character, deletes a character or replaces one character with another.
Given the string password, return the smallest number of edits that makes it strong. If it is strong already, return 0.password='ab' → 4
The password is 4 characters short of six, and it also lacks an uppercase letter and a digit. Four insertions fix everything at once, for example abC12x.
password='Qwerty1111' → 1
Length and character kinds are fine, but four 1s in a row break the rule. Replacing one of them is enough: Qwerty11x1.
password='Spring.Day.2026' → 0
The password is already strong.
password.length ≤ 100password consists of printable ASCII characters other than space (codes 33 to 126)password='ab'
4
Run checks the first 3 tests in your browser. Submit checks all 177 tests on the server, hidden ones included.