Editorial for WC '17 Contest 3 J3 - Uncrackable
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Let's start by iterating over the characters in the password one by one, while tallying up the counts of lowercase letters, uppercase letters, and digits encountered. What remains is to put together an if statement which checks whether all of the conditions described in the problem statement have been satisfied, to determine whether we should output Valid
or Invalid
:
- password length
- password length
- lowercase letter count
- uppercase letter count
- digit count
Comments