Practice
Password Validation Rules
MEDIUMString Processing
A password is valid only if it meets all three rules:
- Length is between 8 and 20 characters inclusive.
- Contains a mix of uppercase and lowercase letters (not entirely one case).
- Contains the exclamation mark character
!.
Read a password and output "Accepted" if all rules pass, or "Rejected" otherwise.
Input: A single string.
Output: "Accepted" or "Rejected".
Example:
Input: My!Hidden
Output: Accepted
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: All criteria met
Inputs: My!Hidden
Expected: Accepted
Test 2: Too short
Inputs: M!word
Expected: Rejected
Test 3: No uppercase
Inputs: my!hidden
Expected: Rejected
Ctrl+Enter
Press Ctrl+Enter to run your code
or Ctrl+Shift+Enter to grade