Day 7
This commit is contained in:
20
day07/ex1/main.go
Normal file
20
day07/ex1/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"aoc2022/day07/common"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rootFolder := common.Parse(*bufio.NewScanner(os.Stdin))
|
||||
folders := rootFolder.GetSubfoldersUnderSize(100000)
|
||||
sum := 0
|
||||
|
||||
for _, folder := range folders {
|
||||
sum += folder.GetSize()
|
||||
}
|
||||
|
||||
fmt.Println(sum)
|
||||
}
|
||||
Reference in New Issue
Block a user