Practice

Password Strength Checker

HARDString Processing

Read a password string. Output Strong if it meets both of the following criteria:

  1. At least 8 characters long
  2. Contains at least one digit (0–9)

Otherwise output Weak.

Input: A single string (the password). Output: Strong or Weak.

Example:

Input:  hello123
Output: Strong

Sample Test Cases

Test 1: 8 chars with digit
Inputs: hello123
Expected: Strong
Test 2: Too short
Inputs: abc123
Expected: Weak
Test 3: 8 chars, no digit
Inputs: abcdefgh
Expected: Weak

Premium Question

This question needs a paid plan — upgrade, or join a class from a teacher who has one. You can read the description and sample tests, but grading is locked.

Sign in to get started