From 8950ee2e3e7c975e89aa9386188680dace093d8f Mon Sep 17 00:00:00 2001 From: James Griffin Date: Fri, 10 Dec 2021 15:07:12 +0000 Subject: [PATCH] Day 10 solution --- README.md | 9 +++ main.go | 3 + ten/input.txt | 90 +++++++++++++++++++++++++++ ten/main.go | 25 ++++++++ ten/navigation.go | 134 +++++++++++++++++++++++++++++++++++++++++ ten/navigation_test.go | 65 ++++++++++++++++++++ ten/test_input.txt | 10 +++ 7 files changed, 336 insertions(+) create mode 100644 ten/input.txt create mode 100644 ten/main.go create mode 100644 ten/navigation.go create mode 100644 ten/navigation_test.go create mode 100644 ten/test_input.txt diff --git a/README.md b/README.md index f7f3dde..6b49c71 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,12 @@ The solution for "nine" is: The sum of the risk level of low points is 439 The product of the three largest basins is 900900 ``` + +### Day ten + +```sh +$ ./aoc2021 --ten +The solution for "ten" is: +The syntax error score is 323613 +The autoComplete score is 3103006161 +``` diff --git a/main.go b/main.go index 2429352..8d7137f 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "unsupervised.ca/aoc2021/one" "unsupervised.ca/aoc2021/seven" "unsupervised.ca/aoc2021/six" + "unsupervised.ca/aoc2021/ten" "unsupervised.ca/aoc2021/three" "unsupervised.ca/aoc2021/two" ) @@ -49,6 +50,8 @@ func main() { day = eight.Init("eight/input.txt") case "nine": day = nine.Init("nine/input.txt") + case "ten": + day = ten.Init("ten/input.txt") default: fmt.Printf("%q does not have a solution.\n", flagParts[1]) help() diff --git a/ten/input.txt b/ten/input.txt new file mode 100644 index 0000000..8ab3c08 --- /dev/null +++ b/ten/input.txt @@ -0,0 +1,90 @@ +(((<(([{{((<[[<><>]<()[]>]{[{}()]<(){}>}>[<([]{})>])(<<(<><>>[<><>]>(<{}()><(){}>)>[(([])<[]()>)])){<((<{}() +{(({({<[[[{[{({}{})[[]{}]}[{(){}}((){})]][{((){}){[]{}}}<(()())<<><>>>]}]]]{([<{<<()()>([][])>({[]()}[{}< +[[{<(([<<{(<[[()()]]{[[]()]<{}>}><{{{}()}<<>[]>><(())[()[]]>>)([{[[][]][()()]}{{()()}}](<{{}()}>))}[([{<< +{<[{<{[({[[[[{<>{}}<{}()>]<{<><>}{[][]}>](<<<>[]>[()()]>[{[]{}>[<>()]])]{{{[()()][<><>]}<[{}()][{}{}] +(<[{[{[((<{[[<()()><{}{}>][(<>{}){{}{}}]]{<[<><>]>{{{}[]}(<>[])}}}(<[[[]{}](<>{})]{[[][]][[][]]}>)>)){<{ +<<<(<(<[[[<[{{[]<>}([]())}([[]])]([[[]<>][()()]]{<()()>([]{})])>]{[[<{[]{}}([]{})>{(<>[]){{}{}}}]]{({{<>[] +[{<(({(<{<{<<{<><>}>({<><>}<<><>>)}{[{[]<>}[[][]]][<()<>>]}}<[[[()()]{<><>}]((<>)[{}()])]{<{()<>} +<[([{{{({<({(<(){}><[]()>)((()())[[]()})})[<{<<>>((){})}<[<><>]{(){}}>>{{(<>[])({}[])}(<()<>>)}]>})}({{({ +{[{{(<[[[<(((([]())[[]<>]){(()())[[]<>]})[{([]<>)[<><>]}<({}{})>])>{[(<<<>{}>(()<>)>)]<{([<><>]<[]()>><<{}[ +(<<[<({[(<{[({<><>}<{}<>>)]}<<([<>[]])(<{}{}>[[]{}])>>>(([{[<>[]][{}[])}<(<><>)({}[])>](<<() +{{[<(((<([{(<[<>{}]({}())>){{[{}]<[][]>}[{<>()}{<><>}]}}][<<{<[]<>>[{}<>]}[<{}{}>]>[<[[]<>]<()()>>[[[] +<<<([([{{<({[{[][]}[{}<>]]}<[(()<>)[{}<>]]>){{{[()<>]}(<<>>({}[]))}(([[]()][[]{}])<([]<>)[<>< +({[[[([[([<{<{{}()}{<><>}>}>])[{(({([][])[{}()]}{(<><>)[[][]]})<<<{}>[{}[]]>(({}())<()<>>)>) +<[{[[[<({<<[{<<>>{{}{}}}{[()[]]}]<[<[]<>>{<>{}}]>>>((<{{[]{}}{<><>}}>[{({}{})<{}<>>}]))}[({ +<({[<{(([[[{<<()<>>((){})><{()[]}<{}()>}}[([<>{}][()<>])]]<(([(){}])<{(){}}[[]()]>)<{[(){}](<>[ +[<<{{[<<{[<{({<>[]})({{}<>})}><<<<()[]>(()<>)>>[{{[][]}[[][]]}((<>)<<><>>)]>][(<{[[][]]<[]<>>}>(<((){}){[]< +({[({(<{<<<<{({}())(()<>)}><({{}[]}<<><>>){[{}<>]}>>]<((([{}{}]<[][]>)({[][]}<{}()>)))<<{[[]<>][[]()]}{<<>< +<[<<([<[(<<{[[(){}]<[][]>]<({}<>)[(){}]>}<[({}[]){()()}]({{}[]}[()()])>>><(<({{}<>}{[]()})[(<> +[[[([<<[<[<{[[(){}]((){})][(()<>)<()>]}(<{[]{}}{[]}>)>]{{[{{<><>}<()<>>}{[(){}]<<>{}>}]([[[]< +((([[[{<{[<{[{<>{}}]}({<[]>[{}{}]}<({}{})([][])>}>(((({}{})<{}()>){<<>{}>{{}<>}})(<{{}<>}{{}} +[<[{[({<[({{{<<>{}><()[]>}}{([<>()]{{}[]})({()[]}[<>[]])}}[{(<()[]>([]{}))<<()<>><[]()>>}{[<<> +<{{([({<{([<<(()<>)[[]{}]><{()()}<<><>>>>]){{<{{()()}<()<>>}>[{(<><>)<[]()>}]}[((<{}()>){[()[]]{()()}})] +<{[([{{[[[<<[<()<>><[]()>][(<>())(()<>)]>(([{}{}]([][])){<[]<>>([]{})})>{[[<{}[]>((){})]{<<> +{[<([{({{({({[[]()]{(){}}}<([]{})[<>{}]>)<<[()[]]>([()[]])>}{[(({}<>)<()()>)[{(){}}<{}{}>]]}>{[[{ +<<({{<<{<[{[{({}{})[()]}(<{}{}><[]()})]<{[[][]]({}[])}{(<>{})<()[]>}>}<[({{}<>}{<>()}){({}[ +([[[<<{<([[(({<>()}{[][]})[[()<>][()]]){{{()[]}(<>[])}<([]<>)[[]<>]>}]])>{(({{{[<>{}]{[][]}}}}<[(({}[])<<><> +[<(({<[[{([{<<()()>(()<>)><<[]{}>{()<>}>}{<<{}>>{{[]{}}<()<>>}}]{<{[{}<>]([][])}}<{[()()][{}]}>})(([[<{} +<{(<{(((<{<<(<<>>{<>{}})[([]<>)(()[])]><[([]{})((){})}<<{}[]>(<><>)>>><{{{<>{}}(<>[])}{[()()][() +<{<[<<[({<[[<{{}[]}><({}{})({}[])>]]<[<{{}<>}>]({[{}]{<>[]}})>>[<(([{}<>]){<<>[]>[<><>]})[(<{}()>{[ +(([[(([<<(<(<{()()}(<><>)><(<>{})<[][]>>)[<((){})<{}{}>>{{()()}{<>{}}}]>[<<<()()>(<>[])><(()[ +<{({{({<[(<{<(<>{})<<>{}>>(({}[]))}(((<>())<{}<>>)(<()>))>([[([]<>)<{}[]>][[<><>]<(){}>]][{<(){}>( +<<{(<(({[<<{[(<><>)[<>{}]]{<[]()>({}{})}}<(<{}[]>)[{<>()}<[]<>>])>>]{((({(<>[]){()<>}}[{[][ +(([((<([[([<[{[]{}}({}[])][<{}{}>[()[]]]>(<<{}[]>>)])([{(<[]{}>([]<>))}<[{<>}[{}<>]]([(){}][{}[]})>] +(([{(([{[<{<<<[][]><()<>>>(({}[]){{}<>})>}({{<[]()>({}[])}([(){}][{}<>])}(([[]<>][[][]])[{{}()}<<> +([(<<([{<[<(<<(){}>{[]()}>((()<>){[]<>}))[{([][])}<[<><>]{{}{}}>]>(({(<>[])[(){}]}(({}[])<<>()>)))]>{{[{[[ +{(((([<{({[(<[<>[]][[]]><(()[])[[][]]>)]({{{(){}}[<>[]]}((()[])<[][]>)}{{<()<>>([][])}<{()>>})}<<(({< +<[({<<{{(({<{{[]{}}(<><>)}<[()[]]<{}()>>)<<{{}[]}>([()[]]({}{}))>}){({{[(){}][<>()]}[[()()][()[ +{<([[{((([[{([[][]]<()<>>)<[<>{}]<{}()>>}]]((<[([]{})[<>()]][<[]>{<>}]><({{}<>}{[]()})(<()()>(<>{}))>)))){(([ +{(([{([{((({[{()[]}((){})]{{[]()}[()()]}}<<<{}[]>>({()()}{[]()})>)((({<>[]}[<>{}])(([]{})))[[{()[]}{<>{} +(<(<[[(((<[<<{{}[]}[[]{}]>[{()[]}<(){}>]>]>)[[([[{()<>}<<>()>]<({}{})<{}{}>>]){{[{<>[]}{()()} +(([[(([(<{([[<()()>[{}{}]][<[]{}><[]()}]]{<<{}<>>>})[[{([]())<[]()>}[<{}{}>[<>{}]]][((()())([]()))([[] +[<([<{({({[[({()<>}[{}{}>)]{([{}()]{{}})[[[]{}]<{}{}>]}]})<{{{{(<>)([]{})}[<[]()><{}{}>]}}{{<[{}()]{{} +<([{[([<(([[(<{}()>([]{}))({{}}(<>()))][{(()<>]([]{})}[[[]<>]{()[]}]]]((<[[]<>][<>]><{{}{} +<<([[<{[[([[{<[]<>><[]{}>}][([<><>]([]()))<[()()]([]<>)>]][[<[()<>][<>[]]>({<>{})[<>{}])]< +<{([[(<(({{<({()}[{}[]])(<[]<>>)>}{{[([][])({}<>)]<<{}{}>{<>[]}>}[[[[]()]({}())]((())[[][]])]>}( +{[[{[<[<<(<{<(<>()){{}<>}>}[<<{}[]>[[][]]>((()[])[()()])]}[{<{{}{}}[{}{}]><[[][]][(){}]>}[[[<>{}]< +{<<{[(<{{[[([<[]()>{{}()}][{<>{}}[<>()]])]({(<[]{}>){{[][]}([]())}}<[[<>]<<>{}>]<{[]()}({}{})>>)]( +[<[[[{<[{[(([{<>[]}<{}<>>][{()<>}[[]<>]]){([[]()]<()>)<[{}{}][{}{}]>})[((<{}{}><<>()>){([]<>]<[][]>})({<< +{<(((<{<{{{<[([]{}){[]{}}]<[[]<>][<>()]>>(<[<><>][<>{}]><[(){}][()()]>)}((<{{}<>}<()[]>>{{[]{}}{ +(<<[[[[{[{{(<(<>{}){[]}>{<[]<>>([][])}){{([]())(()())}}}}){[[{(<<><>><()<>>)<(()[])<{}()>>}]]}}({[(<{[[]() +{({(<{<<<<((<[()<>]((){})>)){<<{<>}([][])>>(<<()()>([]())><[{}{}][{}<>]>)}>>([([[[[]<>]<[]()>]{<()[]><<>() +<{[(({{([(({<<[]<>]>{<<><>>[<><>]}}<(<()()>)[(()<>)]>){[(<{}{}>[{}<>])]})]{(<<[[[][]]([]{})]>>)[<([[()] +{({{<(<<{[([((()<>)<{}<>>)<[<>[]]{{}<>}>](<([][])(<><>}>))[[([[]{}][<><>]){[{}()]({}{})}]<([{}[]]{<><>} +<({[(([[[<<((([]{})<()[]>)((<>)<[]>))(<({}<>)[()()]>[([]<>){{}<>}])>[{[([])([]())]<[()()]<{}<>>>} +{{{[[<{{{[[[(({}[]))]{([{}()][[][]])[[[]<>]([]<>)]}]]((([[<>]{[]{}}]<[<>()]<(){}>>)({[(){}][ +[{{([{{<(<<({[(){}]{()()}}[[[]{}]<<>[]>])>>[<<<{{}()}({}[])>><(<()()>(()()))({[]{}})>><{({<>{}}{<>[]})[<{} +<<<<{{<<[[<[((()[])<{}{}>)<(()[])({}())>](({<>}{{}[]}}{[(){}]{()<>}})>({(<{}<>>(()[]))<<{}[]>{{}[]}>}<{{[][]} +<<((({[{[{<([([]())<()()>][<{}[]>([])]){({()}<()()>)<([]())(<><>}>}><<<{{}<>}[[]<>]>[[()](<><>)]> +(<{[[[[([([[<{<>{}}<[]()>>{<<>[]>}]{((<>{}){[]<>})<(()())([]{})>}](<[([]<>)(<><>)]{<[]<>>(< +[{<(<<<[(<{<[[[][]](<>())][<{}{}><{}()>]><{<[][]><<>[]>}{({}<>)}>}<<[({}())([]())]<<{}{}><()<>>>>[( +[[([({[{([[(<[(){}]<[]{}>>((())(()()))]]((({<><>}(()())){{{}()}}){{[<>()]{{}()}}<[[]<>]<{}()>>})]<(({<[][]> +<<{[(<({{({(<{{}<>}(()<>)><{[]{}}[[]{}]>){[<<>()>{{}}]((()[])[[]{}])}}[((({}<>)[()()])<[{}[]]<<>[]>> +[<{<({{({{{({{()[]}[()[]]})<{(<><>)[()<>]}{{<>{}}}>}<<{({}{})({}<>)}[[()<>][[]{}]]>[([{}[]](()))(<<> +{{({{{[[[(<[<{<>()><{}[]>>{<[]<>>[<>]}]>[<<[<>()]([]{})>{(<>)(<><>)}>(<(<>{})([]<>)>(<(){}>[{}[]])) +<{[{[{[(<<({[({})([][])][[(){}]([][])]}<{<{}<>>{[][]}}{((){}){{}{}}}>)[<{[[]{}][{}{}]}({()()}([]{}))>[[[< +({<<{[<(({[[([[][]])[(<>[])[{}()]]]<{<{}<>><[]<>>}<({}{})<{}()>>>}(<(<()[]>[{}[]])<([])<<>[]>>>{<[<>()] +<<{<{{([(({([{[]<>}[{}{}]]([()()][[]{}]))}[<{{[][]>{{}[]}}{[<>[]]{{}()}}>{((()<>)[(){}])}]))][({[<(<[] +({<[[{((<[[[({<>[]}{[]{}})({{}[]][<>[]])](({()<>}<{}[]>)(({}<>)<[]<>>))][<<<(){}>>{(<>{}){( +({(((<{[([{[(([][])([]<>))[{[][]}<[][]>]]}((<((){})(<><>)>(([][]){<>}))([({}[])<[]()>]{<<>[]>{(){}}}))]({<< +([[[[[([<<{<[<[]<>>([]())]{{<>{}}<<><>>}>[<[()[]][[]<>]>({<>{}}<()})]}[[[(()[])({}())]](((( +([(<<{<(<{<{[[<>]]<[<>[]]({}())>}><<{(()<>)(<><>)}{(<>[])<{}[]>}><<[<>()]<<>>><{{}{}}>>>}>)>}>{{ +({<<{([({{([{{<>}({}{})}([[]()]{[]()})][{<<>()>([])}<[[]{}]}])(([[[]{}]{()[]}]([{}()]<()<>>)) +(<{<[{[(<{([(((){}))[((){})<()()>]]{{[[][]]<(){}>}((<><>)<[][]>)})}{((<([]{})<<>[]>>{<[]{}>{{}<>}}))[({{<>( +<<<{{([[[{[{(((){})[<>[]])([{}()){()<>})}{{({}())}{{<><>}}}][<<[[]<>](<>)>{[()()]{{}()}}>[[<{}{ +<(<[{[([[(({[<{}<>>](([]{})([]()))}({<{}[]><()<>>}<[[][]]<[][]>>))<{[<()()><(){}>]([<><>]({}[]))}>)[[ +<({<<[(({{{([{{}<>}<()()>](({}{})<()<>>))((<(){}>([]{}))([<><>]))}{{<{{}{}}{<>[]}>[{(){}}<(){}>]}( +{{{([[([[<[(<<[]{}><[]()>>(<{}>(<>{})))[([[]{}](()<>))((<><>)[{}()])]]>]<([<((<>[])(<>))[{()()}({})]>] +{[<{((([<[({{{()[]}{()()}}((<>{})[[]<>])>){(<[[][]]>[(()())(<>[])])[<{<>[]}({}<>)>]}][(([[{}()]({} +{<{[(({{[({[[[()()][(){}]]{<[]()>(()[])}]<(<<>()>({}{}))>})<(<<([]<>)(()())>{((){}){<>()}}>)>]{{([[[{}]]]((<< +<<{({[{[[<[({(<>{})({}[])}<([]())[(){}]>)<<{(){}}(()<>)>{({}{})<{}<>>}>]{<[[()()]{{}<>}]({{}}<()()>)>[< +({([{<<{[{(({(()())([][])}({{}[]}((){}))))}([{<{()[]}({}())>[({})[[]{}}]}<([<><>]([]()))>](<{(<>())( +([<{{({<{[[{<{[]<>}>}([{[][]}[[][]]])]({[{[]<>}[[]<>]](({}[])[()()])}{({()()))<{{}[]}{[]{}}>})][[([<() +((({<<(({(<{[<<>[]>]{[(){}]<()()>}}{<{[]}{<><>>>([<>[]]<<><>>)}>{<({(){}})[({}{})([]{})]>({{<>[]}<{}[]>}<<[ +[{<({[[([<<[(({}[])((){}))]({[[][]][[][]]})>(([{[][]}[<>()]]{{<>()}(<>)}){<{<><>}){[()[]]{{}[]}}})>])]({( +{(<(([{{<{[[[(()[])(()<>)][{<>{}}[[][]]]]][{{<{}<>>{{}[]}}({()<>}[[]{}])}{[<{}{}>[[]<>]](<<>{}><(){}> +[(<[<<<({{[<(({}())<()()>){[[]{}]}>({({}())([]{})}([[]()]))]{[[<{}{}><[][]>]<<{}[]>({}())>]{{{()[]}{[][]} +([{[{<<<[{{({[{}()]}<<<>[]>{<>[]}>)((([]<>))([<>{}]))}{{[([]{})<(){}>}((()[])<[]()>)}({[(){} +[({[<[[[(((<<[[]]<[]<>>>>{{([]<>){()[]}}})(({(<><>)({}())})<({{}[]}{[]()})[{()<>}([][])]>) +<[[{[[{{[[[<<{()[]}<[][]>>{<<><>>[{}]}>{[<{}<>><[]<>>](((){}))}]{{<((){}){<>{}}>{(<>())[<>[]]}}<<{{}()}(( +(<[{(<<([[([[<{}{}>[<>[]]]][[{{}()}]<[<>()][()<>]>])<{[(<>{})(()[])]{[{}()][<>()]}}<((<>[]){<>()})(<() \ No newline at end of file diff --git a/ten/main.go b/ten/main.go new file mode 100644 index 0000000..e6dbf62 --- /dev/null +++ b/ten/main.go @@ -0,0 +1,25 @@ +package ten + +import "fmt" + +type Ten struct { + navigation navigation +} + +func Init(filepath string) *Ten { + ten := &Ten{ + navigation: navigation{}, + } + + ten.navigation.load(filepath) + ten.navigation.parse() + return ten +} + +func (d *Ten) Answer() string { + return fmt.Sprintf("The syntax error score is %d", d.navigation.syntaxScore()) +} + +func (d *Ten) FollowUp() string { + return fmt.Sprintf("The autoComplete score is %d", d.navigation.autoCompleteScore()) +} diff --git a/ten/navigation.go b/ten/navigation.go new file mode 100644 index 0000000..f64e714 --- /dev/null +++ b/ten/navigation.go @@ -0,0 +1,134 @@ +package ten + +import ( + "bufio" + "os" + "sort" +) + +var syntaxScores = map[rune]int{ + ')': 3, + ']': 57, + '}': 1197, + '>': 25137, +} + +var autoCompleteScores = map[rune]int{ + '(': 1, + '[': 2, + '{': 3, + '<': 4, +} + +var pairs = map[rune]rune{ + ')': '(', + '}': '{', + ']': '[', + '>': '<', +} + +type errorType string + +const ( + corrupted errorType = "corrupted" + incomplete errorType = "incomplete" +) + +type syntaxError struct { + line string + symbol rune + violation errorType + stack []rune +} + +type navigation struct { + input []string + validInput []string + errors []syntaxError +} + +func (n *navigation) load(filename string) error { + file, err := os.Open(filename) + if err != nil { + return err + } + defer file.Close() + scanner := bufio.NewScanner(file) + for scanner.Scan() { + n.input = append(n.input, scanner.Text()) + } + return nil +} + +func (n *navigation) parse() { + for _, input := range n.input { + stack := []rune{} + var e *syntaxError + for _, r := range input { + switch r { + case '(', '{', '[', '<': + stack = append(stack, r) + continue + case ')', '}', ']', '>': + if len(stack) < 1 || stack[len(stack)-1] != pairs[r] { + e = &syntaxError{ + line: input, + symbol: r, + violation: corrupted, + } + } else { + stack = stack[:len(stack)-1] + } + } + + if e != nil { + break + } + } + + if e == nil && len(stack) > 0 { + e = &syntaxError{ + line: input, + symbol: stack[0], + violation: incomplete, + } + } + + if e != nil { + e.stack = stack + n.errors = append(n.errors, *e) + } else { + n.validInput = append(n.validInput, input) + } + + } +} + +func (n *navigation) syntaxScore() (score int) { + for _, e := range n.errors { + if e.violation == corrupted { + score += syntaxScores[e.symbol] + } + } + + return score +} + +func (n *navigation) autoCompleteScore() int { + scores := []int{} + for _, e := range n.errors { + if e.violation == incomplete { + total := 0 + for i := len(e.stack) - 1; i >= 0; i-- { + total = (total * 5) + autoCompleteScores[e.stack[i]] + } + scores = append(scores, total) + } + } + + // Find the middle value + sort.Ints(scores) + medianIndex := int(len(scores)/2) + 1 + + return scores[medianIndex-1] +} diff --git a/ten/navigation_test.go b/ten/navigation_test.go new file mode 100644 index 0000000..f568787 --- /dev/null +++ b/ten/navigation_test.go @@ -0,0 +1,65 @@ +package ten + +import ( + "testing" +) + +func Test_read(t *testing.T) { + n := navigation{} + if err := n.load("test_input.txt"); err != nil { + t.Log(err) + t.FailNow() + } + + if len(n.input) != 10 { + t.Logf("Expected 10 inputs, found %d", len(n.input)) + t.Fail() + } +} + +func Test_parse(t *testing.T) { + n := navigation{} + n.load("test_input.txt") + + n.parse() + + corruptedLines := 0 + for _, e := range n.errors { + if e.violation == corrupted { + corruptedLines++ + } + } + + if corruptedLines != 5 { + t.Logf("Expected 5 corrupt inputs, found %d", corruptedLines) + t.Fail() + } +} + +func Test_syntaxScore(t *testing.T) { + n := navigation{} + n.load("test_input.txt") + + n.parse() + + score := n.syntaxScore() + + if score != 26397 { + t.Logf("Expected syntax score of 26397, found %d", score) + t.Fail() + } +} + +func Test_autoCompleteScore(t *testing.T) { + n := navigation{} + n.load("test_input.txt") + + n.parse() + + score := n.autoCompleteScore() + + if score != 288957 { + t.Logf("Expected autoComplete score of 288957, found %d", score) + t.Fail() + } +} diff --git a/ten/test_input.txt b/ten/test_input.txt new file mode 100644 index 0000000..2f182d8 --- /dev/null +++ b/ten/test_input.txt @@ -0,0 +1,10 @@ +[({(<(())[]>[[{[]{<()<>> +[(()[<>])]({[<{<<[]>>( +{([(<{}[<>[]}>{[]{[(<()> +(((({<>}<{<{<>}{[]{[]{} +[[<[([]))<([[{}[[()]]] +[{[{({}]{}}([{[{{{}}([] +{<[[]]>}<{[{[{[]{()[[[] +[<(<(<(<{}))><([]([]() +<{([([[(<>()){}]>(<<{{ +<{([{{}}[<[[[<>{}]]]>[]] \ No newline at end of file