This commit is contained in:
2022-12-07 08:17:23 +01:00
parent bae437ae3a
commit e72d239eaa
3 changed files with 169 additions and 0 deletions

24
day07/ex2/main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"bufio"
"fmt"
"math"
"os"
"aoc2022/day07/common"
)
func main() {
rootFolder := common.Parse(*bufio.NewScanner(os.Stdin))
folders := append(rootFolder.GetSubfoldersOverSize(8381165), &rootFolder)
min := math.MaxInt32
for _, folder := range folders {
s := folder.GetSize()
if s < min {
min = s
}
}
fmt.Println(min)
}