Code RoomPassword strength validator
EasyPrep Room Coding #1556

Password strength validator

CodingSecurityEntry–Mid~12 min

Implement a password strength validator for a sign-up form. Return True only if the password satisfies ALL of: at least 8 characters long, contains at least one uppercase letter, at least one lowercase letter, at least one digit, and at least one special character (any character that is not a letter or digit). Otherwise return False.

Implement
password_strength(pw: str) → bool
Examples
in["Abcdef1!"]outtrue
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 12 min
InputExpectedGot
["Abcdef1!"]truenot run yetsample