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.

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 \ge 8
  • password length \le 12
  • lowercase letter count \ge 3
  • uppercase letter count \ge 2
  • digit count \ge 1

Comments

There are no comments at the moment.