From ed90986668cb1c235693319a2b58253c1709673f Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Sat, 9 Dec 2017 11:55:56 +1000 Subject: [PATCH] Add part 2 of day 4, 5, and 6 --- 2017/day/4/problem.txt | 14 ++++++++++++++ 2017/day/5/problem.txt | 8 ++++++++ 2017/day/6/problem.txt | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/2017/day/4/problem.txt b/2017/day/4/problem.txt index a0a2e7d..9fb0d28 100644 --- a/2017/day/4/problem.txt +++ b/2017/day/4/problem.txt @@ -12,3 +12,17 @@ For example: The system's full passphrase list is available as your puzzle input. How many passphrases are valid? +--- Part Two --- + +For added security, yet another system policy has been put in place. Now, a valid passphrase must contain no two words that are anagrams of each other - that is, a passphrase is invalid if any word's letters can be rearranged to form any other word in the passphrase. + +For example: + + abcde fghij is a valid passphrase. + abcde xyz ecdab is not valid - the letters from the third word can be rearranged to form the first word. + a ab abc abd abf abj is a valid passphrase, because all letters need to be used when forming another word. + iiii oiii ooii oooi oooo is valid. + oiii ioii iioi iiio is not valid - any of these words can be rearranged to form any other word. + +Under this new system policy, how many passphrases are valid? + diff --git a/2017/day/5/problem.txt b/2017/day/5/problem.txt index 494c485..8e945e5 100644 --- a/2017/day/5/problem.txt +++ b/2017/day/5/problem.txt @@ -27,3 +27,11 @@ In this example, the exit is reached in 5 steps. How many steps does it take to reach the exit? +--- Part Two --- + +Now, the jumps are even stranger: after each jump, if the offset was three or more, instead decrease it by 1. Otherwise, increase it by 1 as before. + +Using this rule with the above example, the process now takes 10 steps, and the offset values after finding the exit are left as 2 3 2 3 -1. + +How many steps does it now take to reach the exit? + diff --git a/2017/day/6/problem.txt b/2017/day/6/problem.txt index 934cce0..a5c558a 100644 --- a/2017/day/6/problem.txt +++ b/2017/day/6/problem.txt @@ -21,3 +21,10 @@ At this point, we've reached a state we've seen before: 2 4 1 2 was already seen Given the initial block counts in your puzzle input, how many redistribution cycles must be completed before a configuration is produced that has been seen before? +--- Part Two --- + +Out of curiosity, the debugger would also like to know the size of the loop: starting from a state that has already been seen, how many block redistribution cycles must be performed before that same state is seen again? + +In the example above, 2 4 1 2 is seen again after four cycles, and so the answer in that example would be 4. + +How many cycles are in the infinite loop that arises from the configuration in your puzzle input?