2019 day 4, parts 1 and 2

This commit is contained in:
2022-09-20 19:22:13 +02:00
parent f9a80239b4
commit 2694f8d4d0
4 changed files with 139 additions and 2 deletions

View File

@@ -21,4 +21,23 @@ Other than the range rule, the following are true:
/How many different passwords/ within the range given in your puzzle
input meet these criteria?
Your puzzle input is =130254-678275=.
Your puzzle answer was =2090=.
** --- Part Two ---
An Elf just remembered one more important detail: the two adjacent
matching digits /are not part of a larger group of matching digits/.
Given this additional criterion, but still ignoring the range rule, the
following are now true:
- =112233= meets these criteria because the digits never decrease and
all repeated digits are exactly two digits long.
- =123444= no longer meets the criteria (the repeated =44= is part of a
larger group of =444=).
- =111122= meets the criteria (even though =1= is repeated more than
twice, it still contains a double =22=).
/How many different passwords/ within the range given in your puzzle
input meet all of the criteria?
Your puzzle answer was =1419=.