aoc/aoc2015/day01.go

28 lines
335 B
Go

package aoc2015
import (
"aoc/internal/utility"
"fmt"
)
func day01() {
in := utility.GetInput("input/2015/01")
floor, p2 := 0, 0
found := false
for i, c := range in {
if c == '(' {
floor++
} else {
floor--
}
if floor == -1 && !found {
found = true
p2 = i + 1
}
}
fmt.Println(floor)
fmt.Println(p2)
}