Watch
1
0
Fork
You've already forked advent-of-code
0

2021 Day 3

This commit is contained in:
Jeremy Kaplan 2021-12-02 21:48:37 -08:00
commit c13f4ca236
2 changed files with 113 additions and 0 deletions

20
2021/aoc/aoc.go Normal file
View file

@ -0,0 +1,20 @@
package aoc
import (
"bufio"
"os"
)
func ReadLines(path string) (lines []string) {
f, err := os.Open(path)
if err != nil {
panic(err)
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
return lines
}