clean up the increment logic at the bottom

This commit is contained in:
David 2021-12-03 19:00:32 -05:00
parent a1264d825b
commit b6f7a57580
1 changed files with 1 additions and 5 deletions

View File

@ -100,11 +100,7 @@ func partTwo() {
if oxOnes >= oxZeroes {
oxgen += (1 << (i - 1))
}
if coZeroes == 0 && coOnes != 0 {
co2scrub += (1 << (i - 1))
} else if coZeroes != 0 && coOnes == 0 {
co2scrub += (0 << (i - 1))
} else if coOnes < coZeroes {
if (coZeroes == 0 && coOnes != 0) || (coOnes < coZeroes && coOnes != 0) {
co2scrub += (1 << (i - 1))
}
}