add day-02 + benchmarks

This commit is contained in:
2024-12-02 19:28:55 +00:00
parent 67a04b91c8
commit 6e06bd5b16
18 changed files with 458 additions and 0 deletions

34
day-02/cmd/cli/main.go Normal file
View File

@@ -0,0 +1,34 @@
/********************************************************************************
Advent of Code 2024 - day-02
********************************************************************************/
package main
import (
"embed"
"flag"
"fmt"
"log"
problems "github.com/onyx-and-iris/aoc2024/day-02"
)
//go:embed testdata
var files embed.FS
func main() {
filename := flag.String("f", "input.txt", "input file")
flag.Parse()
data, err := files.ReadFile(fmt.Sprintf("testdata/%s", *filename))
if err != nil {
log.Fatal(err)
}
one, two, err := problems.Solve(data)
if err != nil {
log.Fatal(err)
}
fmt.Printf("solution one: %d\nsolution two: %d\n", one, two)
}