cybersecurity · intermediate · ~15 min

Is the password strong enough?

Enforce a composition policy.

Challenge

Implement int password_ok(const char *pw) returning 1 only if pw is at least 8 characters and contains at least one lowercase, one uppercase, and one digit.

Starter code

int password_ok(const char *pw) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.