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)
|
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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user