Day 16: Ticket Translation
Feelings
Felt that I knew exactly what I was doing. Though making objects out of everything is kinda heavy, it's makes processing the data so much easier. Wrote the parser in plain Rust too.
Learnings
- Found out about mdbook
- Started writing this book
- Learned cargo-edit:
cargo install cargo-edit,cargo add package,cargo upgrade(which tried messing with my ^1.0.0 versions)
Task
Part 1
Using the rules, figure out how many tickets are valid. All values of tickets should match some rule.
Part 2
Figure out which field matches which rule.
Input example
class: 1-3 or 5-7
row: 6-11 or 33-44
seat: 13-40 or 45-50
your ticket:
7,1,14
nearby tickets:
7,3,47
40,4,50
55,2,20
38,6,12