[Day 24] - Part 1 wrong answer for input

  1. Make sure that you're only playing with groups that are alive. Once a group dies, they need to be removed from consideration entirely. Also be sure that the immune system is only attacking the infection and vice-versa.

  2. There's a lot of sorting going on. There's a sort order for who gets to pick enemies first (by effective power then initiative), another order for which enemy they actually pick (by damage inflicted, effective power, then initiative), and another order for the actual attacking (initiative). Lots of opportunity for bugs if you're not careful.

  3. Parsing bugs! Double-check your group stats and ensure that the numbers are correct. Also make sure the weaknesses / immunities were extracted correctly.

  4. Don't "gang up" on any given group during the attack phase -- it's max one attacker per group per round. Once someone's been picked for attack, no one else can pick them that round.

  5. If a group can't actually do anyone else any damage, skip over them and don't factor them into anything.

/r/adventofcode Thread