Structure
This commit is contained in:
22
day01/ex1/main.go
Normal file
22
day01/ex1/main.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"aoc2022/day01/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
inventories := common.Parse(*bufio.NewScanner(os.Stdin))
|
||||
|
||||
largestInventoryTotal := 0
|
||||
for _, inventory := range inventories {
|
||||
currentTotal := inventory.GetTotal()
|
||||
if currentTotal > largestInventoryTotal {
|
||||
largestInventoryTotal = currentTotal
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(largestInventoryTotal)
|
||||
}
|
||||
Reference in New Issue
Block a user