diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-04-08 12:40:30 -0400 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-04-09 10:21:36 -0400 |
| commit | 9282e95e8844afe856ba76ceb6d2c3010df8bb1a (patch) | |
| tree | e35affc89b20324371381e079f7cb5f8a06aa81b /src/16/part2 | |
| parent | 2b5d4232879dc74491dabf54a0ddc958d66ebcec (diff) | |
| download | aoc2020-zig-master.tar.gz aoc2020-zig-master.zip | |
Diffstat (limited to 'src/16/part2')
| -rw-r--r-- | src/16/part2 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/16/part2 b/src/16/part2 new file mode 100644 index 0000000..71dfbaf --- /dev/null +++ b/src/16/part2 @@ -0,0 +1,32 @@ +--- Part Two --- + +Now that you've identified which tickets contain invalid values, [1m[37mdiscard those tickets +entirely[0m. Use the remaining valid tickets to determine which field is which. + +Using the valid ranges for each field, determine what order the fields appear on the tickets. The +order is consistent between all tickets: if seat is the third field, it is the third field on every +ticket, including [1m[37myour ticket[0m. + +For example, suppose you have the following notes: + +class: 0-1 or 4-19 +row: 0-5 or 8-19 +seat: 0-13 or 16-19 + +your ticket: +11,12,13 + +nearby tickets: +3,9,18 +15,1,5 +5,14,9 + +Based on the [1m[37mnearby tickets[0m in the above example, the first position must be row, the +second position must be class, and the third position must be seat; you can conclude that in +[1m[37myour ticket[0m, class is 12, row is 11, and seat is 13. + +Once you work out which field is which, look for the six fields on [1m[37myour ticket[0m that +start with the word departure. [1m[37mWhat do you get if you multiply those six values +together?[0m + + |
