add day-04 + benchmarks

This commit is contained in:
2024-12-05 01:31:44 +00:00
parent fca32422e4
commit e7aa98d637
19 changed files with 498 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package util
import (
"bufio"
"io"
)
func ReadLines(r io.Reader) ([]string, error) {
lines := []string{}
scanner := bufio.NewScanner(r)
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
if err := scanner.Err(); err != nil {
return []string{}, err
}
return lines, nil
}