Structure

This commit is contained in:
2022-12-01 07:50:35 +01:00
parent d4eb4a757c
commit 9fe1abe08c
5 changed files with 15 additions and 10 deletions

22
day01/ex1/main.go Normal file
View 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)
}