36 lines
709 B
Go
36 lines
709 B
Go
|
package d10
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestP1(t *testing.T) {
|
||
|
in := `[({(<(())[]>[[{[]{<()<>>
|
||
|
[(()[<>])]({[<{<<[]>>(
|
||
|
{([(<{}[<>[]}>{[]{[(<()>
|
||
|
(((({<>}<{<{<>}{[]{[]{}
|
||
|
[[<[([]))<([[{}[[()]]]
|
||
|
[{[{({}]{}}([{[{{{}}([]
|
||
|
{<[[]]>}<{[{[{[]{()[[[]
|
||
|
[<(<(<(<{}))><([]([]()
|
||
|
<{([([[(<>()){}]>(<<{{
|
||
|
<{([{{}}[<[[[<>{}]]]>[]]`
|
||
|
assert.EqualValues(t, 26397, P1(in))
|
||
|
}
|
||
|
|
||
|
func TestP2(t *testing.T) {
|
||
|
in := `[({(<(())[]>[[{[]{<()<>>
|
||
|
[(()[<>])]({[<{<<[]>>(
|
||
|
{([(<{}[<>[]}>{[]{[(<()>
|
||
|
(((({<>}<{<{<>}{[]{[]{}
|
||
|
[[<[([]))<([[{}[[()]]]
|
||
|
[{[{({}]{}}([{[{{{}}([]
|
||
|
{<[[]]>}<{[{[{[]{()[[[]
|
||
|
[<(<(<(<{}))><([]([]()
|
||
|
<{([([[(<>()){}]>(<<{{
|
||
|
<{([{{}}[<[[[<>{}]]]>[]]`
|
||
|
assert.EqualValues(t, 288957, P2(in))
|
||
|
}
|