AoC 2020 D2: Password Philosophy
| Problem statement | Source code | Tags: Brute force
← Previous Back to AoC Index Next →
Part 1
Nothing to say here. Just parse the input and check the counts.
Part 2
The left position check is password[ind_range[0] - 1] == char and the right position check is password[ind_range[1] - 1] == char. We want exactly one of them to be true, so we can use !=.