aboutsummaryrefslogtreecommitdiffstats
path: root/src/02/part2
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-04-08 12:40:30 -0400
committerLouis Burda <quent.burda@gmail.com>2023-04-09 10:21:36 -0400
commit9282e95e8844afe856ba76ceb6d2c3010df8bb1a (patch)
treee35affc89b20324371381e079f7cb5f8a06aa81b /src/02/part2
parent2b5d4232879dc74491dabf54a0ddc958d66ebcec (diff)
downloadaoc2020-zig-master.tar.gz
aoc2020-zig-master.zip
Restructure repo and update solutions to zig 0.10.1HEADmaster
Diffstat (limited to 'src/02/part2')
-rw-r--r--src/02/part218
1 files changed, 18 insertions, 0 deletions
diff --git a/src/02/part2 b/src/02/part2
new file mode 100644
index 0000000..97f255b
--- /dev/null
+++ b/src/02/part2
@@ -0,0 +1,18 @@
+--- Part Two ---
+
+While it appears you validated the passwords correctly, they don't seem to be what the Official Toboggan Corporate Authentication System is expecting.
+
+The shopkeeper suddenly realizes that he just accidentally explained the password policy rules from his old job at the sled rental place down the street! The Official Toboggan Corporate Policy actually works a little differently.
+
+Each policy actually describes two positions in the password, where 1 means the first character, 2 means the second character, and so on. (Be careful; Toboggan Corporate Policies have no concept of "index zero"!) Exactly one of these positions must contain the given letter. Other occurrences of the letter are irrelevant for the purposes of policy enforcement.
+
+Given the same example list from above:
+
+
+ - 1-3 a: abcde is valid: position 1 contains a and position 3 does not.
+ - 1-3 b: cdefg is invalid: neither position 1 nor position 3 contains b.
+ - 2-9 c: ccccccccc is invalid: both position 2 and position 9 contain c.
+
+
+How many passwords are valid according to the new interpretation of the policies?
+