comparison 2017/day04/problem @ 34:049fb8e56025

Add problem statements and inputs
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 09 Jan 2018 21:51:44 -0500
parents
children
comparison
equal deleted inserted replaced
33:bc652fa0a645 34:049fb8e56025
1 --- Day 4: High-Entropy Passphrases ---
2
3 A new system policy has been put in place that requires all accounts
4 to use a passphrase instead of simply a password. A passphrase
5 consists of a series of words (lowercase letters) separated by spaces.
6
7 To ensure security, a valid passphrase must contain no duplicate words.
8
9 For example:
10
11 aa bb cc dd ee is valid.
12
13 aa bb cc dd aa is not valid - the word aa appears more than once.
14
15 aa bb cc dd aaa is valid - aa and aaa count as different words.
16
17
18 The system's full passphrase list is available as your puzzle input.
19 How many passphrases are valid?
20
21 Your puzzle answer was 451.
22
23 --- Part Two ---
24
25 For added security, yet another system policy has been put in place.
26 Now, a valid passphrase must contain no two words that are anagrams of
27 each other - that is, a passphrase is invalid if any word's letters
28 can be rearranged to form any other word in the passphrase.
29
30 For example:
31
32 abcde fghij is a valid passphrase.
33
34 abcde xyz ecdab is not valid - the letters from the third word can
35 be rearranged to form the first word.
36
37 a ab abc abd abf abj is a valid passphrase, because all letters
38 need to be used when forming another word.
39
40 iiii oiii ooii oooi oooo is valid.
41
42 oiii ioii iioi iiio is not valid - any of these words can be
43 rearranged to form any other word.
44
45 Under this new system policy, how many passphrases are valid?
46
47 Your puzzle answer was 223.
48
49 Both parts of this puzzle are complete! They provide two gold stars: **