mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2024-12-21 23:56:30 +00:00
bug
This commit is contained in:
parent
88857ca3ce
commit
a673cc99db
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user