mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2024-12-22 08:06:25 +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(' ')
|
amount, char = rule.split(' ')
|
||||||
minimum, maximum = map(int, amount.split('-'))
|
minimum, maximum = map(int, amount.split('-'))
|
||||||
if alternative:
|
if alternative:
|
||||||
return (password[minimum - 1] == char) ^ (password[maximum - 1] != char)
|
return (password[minimum - 1] == char) ^ (password[maximum - 1] == char)
|
||||||
else:
|
else:
|
||||||
occurrences = password.count(char)
|
occurrences = password.count(char)
|
||||||
return minimum <= occurrences <= maximum
|
return minimum <= occurrences <= maximum
|
||||||
|
Loading…
Reference in New Issue
Block a user