This commit is contained in:
cupcakearmy 2020-12-02 13:14:40 +01:00
parent 88857ca3ce
commit a673cc99db

View File

@ -7,7 +7,7 @@ def checkRow(row: str, alternative=False) -> bool:
amount, char = rule.split(' ')
minimum, maximum = map(int, amount.split('-'))
if alternative:
return (password[minimum - 1] == char) ^ (password[maximum - 1] != char)
return (password[minimum - 1] == char) ^ (password[maximum - 1] == char)
else:
occurrences = password.count(char)
return minimum <= occurrences <= maximum