aoc/aoc2015/day01.go

28 lines
331 B
Go
Raw Normal View History

2024-07-24 14:29:59 +00:00
package aoc2015
import (
"aoc/internal/input"
"fmt"
)
func day01() {
in := input.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)
}