diff --git a/2020/day05.go b/2020/day05.go index 3917a62..2fa82ee 100644 --- a/2020/day05.go +++ b/2020/day05.go @@ -42,5 +42,16 @@ func main() { fmt.Println("Highest Seat Number:", max) case "2": // build a map of all seat numbers then just print the ones between 0 and 1024 that don't exist + seatMap := make(map[int]bool) + for _, line := range values { + seatNumber := calculateSeatNumber(line) + seatMap[seatNumber] = true + } + + for i := 0; i < 1024; i++ { + if _, ok := seatMap[i]; !ok { + fmt.Println("Didn't find seat ", i) + } + } } }