Python Solution for 2020 Advent of Code - Day 16 - Ticket Translation

preview_player
Показать описание
You don't speak the language, but you need to know what the data on your train ticket means. Let's melt our brains figuring things out!

Series 10 Episode 8 of Taskmaster was absolutely horrible!

Bradley Sward is currently an Associate Professor at the College of DuPage in suburban Chicago, Illinois. He has earned a Masters degree in Software Engineering from DePaul University, a Masters degree in Computer Science from the University of Illinois at Springfield, and two Bachelors degrees in Computer Science and Molecular Biology from Benedictine University. Prior to teaching, Bradley worked for five years in the field of casino gaming on a variety of video slot machine and poker games. The Village People have been permanently etched into his brain.
Рекомендации по теме
Комментарии
Автор

You could have solved it programmatically to the end. First you need to check index by index what are possible fields (class, seat, row etc...) for that specific index. You'll find that the index 9 has only one possible field which is seat. Once you know that seat must be index 9, you can remove it from other indices. Doing that iteratively (while loop, end condition would be all indices having only one possible field) you will end up with every index having only one possible field.

slinden
Автор

I remember I did day five by hand because control F worked just fine

sirgems
welcome to shbcf.ru