don't actually need to store passes in the first go-round

This commit is contained in:
David 2020-12-05 12:07:19 -05:00
parent 2828ad3af3
commit 75097ac3a8

View File

@ -54,18 +54,10 @@ func partOne() {
reader := bufio.NewReader(f) reader := bufio.NewReader(f)
scanner := bufio.NewScanner(reader) scanner := bufio.NewScanner(reader)
passes := []boardingPass{}
maxID := 0 maxID := 0
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()
row, column := parsePassID(line) row, column := parsePassID(line)
passes = append(passes, boardingPass{
passID: line,
row: row,
seat: column,
id: (row * 8) + column,
})
if (row*8)+column > maxID { if (row*8)+column > maxID {
maxID = (row * 8) + column maxID = (row * 8) + column
} }