Day 1
This commit is contained in:
21
01/1.go
Normal file
21
01/1.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
inventories := 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