You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
aoc2020/day10/solve1.go

26 lines
306 B

package day10
import (
"log"
)
func Solve1() {
count1 := 0
count3 := 0
for key, value := range rows {
if key+1 >= len(rows) {
break
}
if value+1 == rows[key+1] {
count1++
}
if value+3 == rows[key+1] {
count3++
}
}
log.Printf("2020-12-10.01: Answer: %d\n", count1*count3)
}