don't actually need to store passes in the first go-round
This commit is contained in:
parent
2828ad3af3
commit
75097ac3a8
@ -54,18 +54,10 @@ func partOne() {
|
||||
reader := bufio.NewReader(f)
|
||||
scanner := bufio.NewScanner(reader)
|
||||
|
||||
passes := []boardingPass{}
|
||||
maxID := 0
|
||||
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
row, column := parsePassID(line)
|
||||
passes = append(passes, boardingPass{
|
||||
passID: line,
|
||||
row: row,
|
||||
seat: column,
|
||||
id: (row * 8) + column,
|
||||
})
|
||||
if (row*8)+column > maxID {
|
||||
maxID = (row * 8) + column
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user