add some comments

This commit is contained in:
David 2020-12-16 19:15:23 -05:00
parent 0883efd35e
commit e1d3ca5ea2
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ func partTwo() {
}
guesses := guessFields(rules, tickets)
var lastRuleSolved int
// iterate over the guesses list. on every iteration, only one field has only one rule remaining that's valid
// save it off into the rules list, then remove that rule from all fields.
// Luckily, we don't need any higher-order elimination logic.
for i := 1; i < len(guesses); i++ {
for i, g := range guesses {
if len(g) == 1 {