Log in to get your input and submit your answers.

Day 02: Intra Passwords

Following a late-night, overly hasty update to the PC authentication system, the sessions database got corrupted. As a result, hundreds of account passwords no longer comply with the school's security policy.

The Bocal extracted the list of stored passwords for you, along with the security rule that is supposed to apply to each of them.

Part 1

Each line in your report contains a security rule followed by its associated password:

1-3 a: abcde

This rule means that the password must contain the letter a at least 1 time and at most 3 times.

Example

Take this excerpt from the database:

1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc

In this example, there are 2 valid passwords.

Analyze your own data file. How many passwords are valid according to their respective rules?