Compare commits
2 commits
daec76d3d4
...
f82eaa9490
Author | SHA1 | Date | |
---|---|---|---|
f82eaa9490 | |||
0b617a70d0 |
3 changed files with 142 additions and 0 deletions
2
2021/data/day10.expected
Normal file
2
2021/data/day10.expected
Normal file
|
@ -0,0 +1,2 @@
|
|||
278475
|
||||
3015539998
|
110
2021/data/day10.input
Normal file
110
2021/data/day10.input
Normal file
|
@ -0,0 +1,110 @@
|
|||
{<<<[<(<{[[[[<<><>>({}())]<<[]{}>{<><>}>]]<({<[]{}>}<[[]{}]{[]<>}>){({{}<>}[<>[]))<({}())<{}<>>>}>]([{[<{}<>
|
||||
{{{<(<<{<([[<{[][]}<<><>>>{{(){}}}]<{[{}{}][<><>]}[[[]()][()[]]]>])(<{([[]][<>{}])[([]<>){[][]}]}(([[]()]
|
||||
(([{<{<<{((({[()[]]([][])}[{()}(<>)])[<(()<>)>(([])[{}[]])]){{([()()){[]()})}})}({<<[(()<>){()}
|
||||
{[[{[[[{[[<(({{}}{{}()}){{()<>}{<>()}})>({<{(){}}>{(<>{})(())}}((({}()))({[]()}<()()>)))]<(
|
||||
<<[({({(((<<[[<>{}]{<>()}]{[<>{}][[]()]}>([[<>]]{{<><>}[<>[]]})>)){[<[[<<>()>{<>{}}][(()<>){[]{}}]]>}<[[<
|
||||
({<([{({{<{{<{(){}}<()[]>><{()<>}(()())>}[([{}[]]<<>{}>){<[][]>({})}]}<{({{}[]}<[][]>)((<>{})(()<>))}<{<{}(
|
||||
{([{{[({[<<(([[]()])<(<>())[<>[]]>]{([[]{}]([]()))}>([{{[][]}({}{})}(([]{})[[]<>])])>[<<[{<><>}[
|
||||
<[<([<(<<{{<(<[]<>>)><(<{}[]>[[][]]){{{}()}[[]()])>}}><[<(({<><>}{(){}})([<>[]]))>]>>{[<<[{([]{})[<>{}]}[
|
||||
{{{{({((((<{[([]{})<<>{}>]({<>})}<(<()<>><[]{}>)<(()())({}<>)>>>)<{[{{<>{}}}]}([[{()()}{[]()}
|
||||
[<(({((<{{<({(()())((){})}[[()<>]{{}[]}])<<[()<>]><{<>{}}{<>{}}>>>}{(((<<>{}>{()[]})([[][]][(){}]))[(<
|
||||
<<[({{<{{<({<{<><>}(<>[])>{[[]{}][()]}}){<<([]())(()<>)>[{()[]}]><[[<>{}]({}())](<[]<>>{<>()})>}>{[
|
||||
{{(({<[[<<{{{<[]{}>({}())}}{{[{}()]<()()>}((<>{}})}}<{<[()()]{[][]}>(((){}){{}[]})}>>[{<[[<>[]](())]
|
||||
[((({{{({[<(<({}<>)<{}[]>>)[[[[][]](()[])]({{}{}}{()[]})]>[(<[<>()][<>()]>[[[]()]((){})])]
|
||||
{<<<{[<{<{<[{[<>]<[]()>}{<<>[]><()<>>}]>{[[<(){}>({}())][{()[]}{{}<>}]](<[[]<>]{()<>}>[{[]{}}[
|
||||
{<[<[{({[<{{{{<><>}{{}()}}{<<><>>(<>{})}}{[{{}{}}<()<>>]{[<>{}]}}}({[[{}()]<{}[]>][<{}<>><[]{}>]}{<<<>
|
||||
(<[<([<[{(<(({[][]}(()[]})[<{}()><{}()>]){[[{}[]]{{}<>}]}>{[{<{}()>{{}()}}<<<>{}>{[]<>}>]})(<{{(<><>
|
||||
[[{{[[({[[[<{(<><>)<{}()>}({<>{}}(()<>))>]<<[{()()}[<>]]<{[]()}[<><>]>>>][<{(({}<>)){<{}{}}[[]{}]}
|
||||
(((<[({[([({[([]{})[<>()]]<{(){}}(()())>}[{(()<>]<{}{}>}[{{}<>}<{}()>]]){<<[<>()]<[]>><[[]()](<>(
|
||||
[(({{<[([{<<[{[]{}}<[]{}>]({()[]}[()])>>}])<{{{[({<>[]}(<>[]))([{}()]({}[]))]<{[{}()]{{}<>}}{<{
|
||||
<[(<[<[{<<{(<[<>{}]<[]()>>{((){}){()<>}})}<<<[{}{}][<><>]>>(([()()][<>]){<{}()><<><>>})>>[{({<{}
|
||||
{(<{<{[<{<({<{[]<>}[<>()]]<[[][]][()()]>}({({}<>){<><>}}[<<>()>{[][]}])){[[{<>()}({}[])](({}[])<{}>)]([
|
||||
{([<{<(([<{[[<<>><[]()>]{(<>{})[{}{}]}}[((()()){<>[]})[(<>[]){()<>}]]}>])([{([<(<>())[{}<>]>][[(()<>)<{}[]>
|
||||
[(((<[<{{<[<{{{}[]}}><<<()[]>({}<>)>{{{}[]}[<>()]}}]{{{({})[{}()]}({(){}}<{}[]>)}({({}[])(())}{(<><>)[<>{}]}
|
||||
{{[(<{(<[<[<<{{}}[()()]>><[({}{})][<{}()><{}>]>]{[{[{}][<><>]}[[()()]([]{})]]{{({}()){(){}}}<{[]{}}<
|
||||
[{{<{<([(<[<[{()[]}]{<(){}>}>[([()<>][<>()])[{()<>}[<>[]]]]]>)])>}{([[<{<{{[()<>]{()()}}<[<><>]<<>[]>>)[{[()(
|
||||
<(({<[[[[(({({<>[]}[{}])<<{}()>{(){}}>}{({{}[]}{()[]}){{<><>}[<>{}]}})<[{{()()}[()()]}]({{<><>}<()()>}[<(
|
||||
({{{([{<{[[[[<[]()>{(){}}]{([]{})[{}[]]}][[{[]()}]<[()[]](<>[])>]]((<[<><>]{(){}}><<{}{}>>))]}(
|
||||
([<[({[[([{<(<<>()><{}[]>){[()[]][(){}]}>}({((<>()){()()})}{({{}()}<<>()>){[{}]<[]()>}})])([<(
|
||||
{<<[[<(([({[<[[]]((){})><{[]()}{()<>}>]}<<(<<><>>(()())){{<>{}}}>>)]])<(<<<<[{{}()}[[]()]]((()))>(
|
||||
[[{{{[[[[(<{[(()[])[[]]][(()[])((){})]}[{{<><>}{{}()}}([[]()])]><([<<>()>{{}()}])>)({([[[]]>{<()<>>[{}<>]}
|
||||
{{({[{<<<[(({[<>[]>{<>()}}){<{[]<>}>({{}<>}<()>)})(<{(()())<()()>}({[][]}[(){}])>(<[()[]][<>[]]>[{()<>}
|
||||
({[[[<[<[{[({<<>()><<><>>}{{<>()}<()<>>})]<<[[<><>]<[]()>][[()][{}{}]]>{[{[]{}}([]<>)]<({}{})(<>{})>}>}]>[[{[
|
||||
<<<(({{{[{([(({}{})([]<>))<[<><>]{<>{}}>]<(<<>[]>(<>[]))[([]<>)[()[]]]>)(<[[()()]{[]{}}][{()[]}{(){}}]>[<({
|
||||
{[[((([[<{{{(<(){}>{<>()})}}}[((<([]<>)[[][]]>{<{}[]>[<>]})[{[(){}]}{<(){}><<>()>}])<{([[]<>])[((){}
|
||||
{[[(({{{<<<<[<[]<>>]><[{<>{}}]([{}<>]<()()>)>>>{[[<<[]{}>>[{<>()}]]{[{[][]}{[]()}][{(){}}[()]]
|
||||
<[([([[[[(([((<><>)[<>]){([][]){[][]}}]({[()[]>{()[]}}{{<>{}}(()[])}))){<<{<{}[]>{{}()}}><[[<>[]]<<><>>]
|
||||
{(([{([(<[((<<[][]>((){})>)<((<>{}){[][]})(<<>[]>)})]><[((((()){<>()})[{[]()}{<>{}}]))]>)[[<<<{[<
|
||||
{([([(({[{{<([<>[]][<>{}])>([<{}()>(<>)]{[()[]]<[]<>>})}<[[[[]()][{}{}]]([()()])][(<()()>[()[]
|
||||
{<(<({({<(<[{<{}()>[<><>]}[{()[]}{{}<>}]]{[{[]()}<<>{}>]([[]<>](<>()))}>(([[[][]](<>())})[({<><>}[()<>])]))>}
|
||||
<((<(<<<{{{<[<[][]>([]{})]><(<(){}>[()<>])>}<[{<[][]>{<><>}}](({{}<>}))>}[<{{(<><>)<<><>>}(<[]{}>[[]()])}>
|
||||
[<<{{(<[{<([[[(){}]<{}{}>]<[{}()]>][[{{}()}[()<>]](<<><>>[{}<>])])([<({}{})[{}<>]>{{()()}}]{[{[
|
||||
[[[<[<<{{{[[[[[]{}](()())]]{{{<><>}((){})}[({}<>)([][])]}]({[[<><>]([][])][{<>{}}(()())]}{[[<>[]]
|
||||
{(<[[[<{<<[[{{{}[]}[{}{}]}<<<>()>[{}{}]>]({{[]{}}{[]<>}}<<(){}>[()]})]<[{({}[])[()()]}<[<><
|
||||
[<[<([{({[{<(<<><>>[()<>])[[{}<>][<>[]]]><[<()<>>]<([][])>>}<({{<>{}}{{}{}}}([()()][(){}]))[<({}<>)([]())>({[
|
||||
[{[[<[{{{{[{(({}[])(()()))([(){}]{[]{}})}][{<(<>())<{}()>><({}[])[()<>]]}<<[[]{}][[]()]>{{
|
||||
{<{<[<<{[{<[[[(){}]][({}{}){()<>}]]({[<><>](<>{})})>[{{[{}[]]<<>{}>}[[(){}]([][])]}{(({}[]){[]
|
||||
[<((<<{((([<{<()()>[{}[]]}[<[][]}<()()>]>]<[<[<><>]{()<>}><{(){}}<(){}>>]>){{[([{}<>][(){}]){{[
|
||||
<[{(<<<<<{[<[<()<>><(){}>]>{[{()()}[()[]]]}}}{[<{[{}{}]([][])}(([]{})[(){}])>]{<[{(){}}[()<>]][({}[]){()()}]>
|
||||
{<{{[({{<{[<{(<>()]{<>{}}}<<<><>>{()<>}>>[{([]{})}<{[]()}{<>[]}>]][([<()[]>{<>{}}]([{}{}]{(){}})
|
||||
<({([({[(<[(({[]()}{{}()}){[(){}]})][{<<<>[]>{()()}>}(<{{}<>}{[][]}>{[<><>](<>())})]>[[[{({}{})<(){}>}
|
||||
[(<[[[<[{(([{{<>{}}([]{})}[{<>()}{<><>}]]<{(()())<{}[]>}{(<>)[<>[]]}>){{({<><>}(()))}({<[]{}>{<>[]}})})
|
||||
<[{([([[([<[([()()]((){})){([]())(()[])}]<<{()[]}<{}[]>>{{[]()}<<>[]>}>>(<[<[]{}>[{}]]>)][(
|
||||
(([<<(<[<<[<[[()()]{[]()}}{<{}{}>{{}<>}}>[<<<>()>[[]{}]>[({})[<>()]]]](<{{<>[]}[{}{}]}[(()())]>[[{{
|
||||
[{<[<((((([{(<[]()>([]{}))<[<><>]>}[(([]{})[{}{}])<({}())<[]<>>>]])))))([<<({<<[{}{}]><{()<>}{[]()
|
||||
<<[<<[[[<{<[{{<>()}(<>{})}([[][]])]{[(<><>)(<><>)]((()<>)[()[]])}>[<[<()[]>[(){}]]((<>())[()<>])>]}>]]
|
||||
<<{<[([[((<[[{<>{}}]<[()<>]([]{})>]{<({}<>){()()}><<()()>>}>[<<<<>()>{[]()}><<()()><<>()}>>])
|
||||
{(<[{{([{<(<{[{}{}]<<><>>}([<>{}][[]()])>(([<>[]])[{{}[]}{{}{}}]))[(({<>()}<()()>){([]{}){[]
|
||||
{<[<<[<[<<{[(<{}{}>)<[<>[]](<><>)>]{(({}<>)[<>[]]){<{}<>>([]{})}}}>[[<[[{}()]{[]()}]>]{[{{{}()
|
||||
(<<<<<<<([{(<[<>{}]([][])>{{[]<>}])}{<<<()<>><()()>>[{{}()}[{}{}]]>[[[{}()][[]<>]]{<{}[]>[(){}]}]}])
|
||||
([<[<[[{[(<<{([][]){<>()}}[<()<>>(()[])]>{{(())(()())}{({}[]){[]()}}}><[([(){}])({{}{}})]>)(({[[[][]
|
||||
<(<[[<([{<([<[[][]]({}())>>){{(([])[<><>])<{<>[]}[{}()]>}{[<()>[{}{}]]((()[]){<>})}}>}[<<{[[()
|
||||
({<<{[{[(({{<{()()}>[(<>[])]}[([{}<>]{[]{}}){{{}()}<{}<>>}]}{<({[]}[{}()]){{(){}}[<>{}]}><{[<><>
|
||||
({<[([[(<{<{{[[]<>](()[])}{<[]<>>(<>[])]}>{[[{{}{}}][{<>[]}(<>)]]<<<()()>({}<>)><<{}()>{{}()}>>}}>[(<[(<{}<>>
|
||||
[[((<{<<[{{<<<[][]><[]{}>>>{[<()()>]<<[]<>>((){})>}}}{<(<((){}){{}<>}>[([]<>)<{}[]>])<[[{}{}](<><>)]{([
|
||||
<{{({([([{{((({}<>)(()()))[(<>{})<[][]>])(<{<><>}([]<>)>{(()[])[[]{}]})}{<{{{}()}({}())}[([]{
|
||||
{<[(<{[<{[[(<<{}<>>[[]<>]>}{[<[]<>>[{}()]]{[{}](<>)}}]]}{{({(<{}{}>[()[]])[[{}{}][{}]]}<<<<>{}>>[([][
|
||||
({<{<<[([<[[<<{}[]>(()[])>][[([][]>[<><>]]{{()}}]](<((<>[])<<><>>)[({}()){{}[]}]><([[]<>]{<>[]})
|
||||
<{({[{{{<[<[{<()()><{}[]]}{[[]{}]([]<>)}]{{([]()){<>()}}{{{}<>}({}<>)}}>[<<<[]()>[{}[]]><(()())[<>[]]>>(
|
||||
{(([((<[<({{{<()()>[()<>]}<[{}{}]<<>[]>>}(<{[]()}{()[]}>([{}[]]({}())))}({{<{}{}>[<>{}]){{[]()}{[]<>}
|
||||
(([({{[[(<[<(<<><>>[[]()]){([]())({}<>)}>[((()()){()()})[({}())<[]()>]]]>[{{<[{}{}][{}()]>}{([<><>]<
|
||||
[[{<{([<[{(((<()()>{{}[]}}<<{}{}>[{}[]]>){(((){})[{}<>])<<(){}>(<>{})>})}(([<(<><>)<[]<>>>([<>()])]<[({}{
|
||||
<[{(<[(<<{<{<({}{})<(){}>>([[]{}]{()<>})}[{{[][]}[[]]}([()](<>()))]>[{(({}[])(()())>([{}])}{(<[]()>{
|
||||
<{({{<{{{{{{<[()()]([]{})>{([]{})[()()]}}}}}}({(<[{([]{})({}{})}{(<>())<{}<>>}]({{<><>}}[{()<>}[[
|
||||
{{[({(<{[([[<<()()>{()[]}><{()<>}{{}{}}>]]<{[{()<>}(()<>)][<{}{}>([][])]}<{<[][]>[()()]}<{()<>}[[][]]>>>)]
|
||||
(<({{({{{([({{{}()}{(){}}}<{(){}}<<>[]>>)(<[[]<>][<>{}]><[<>{}]>)]{[{(()[])}{[[]<>]{{}}}]((((){}){<>
|
||||
<(([(((((((({([]<>)}<(()<>)<<>[]>>)[{[[]{}][()<>]}<{()<>}>])<<<{(){}}[<>()]>{(()()){[]<>}}>
|
||||
<<<<{{{[[([<{{<>()}[{}<>]}<<(){}><[]{}>>>([[[]()]<{}()>})]({[[{}()]{<>()}][{[]<>}[(){}]]}))((
|
||||
{[(<<<<({(<[[{{}}]<(()<>)<{}<>>>]<([[][]]({}<>)){[()[]]<(){}>}}>)}[[[([[[]<>]<()()>][{[]{}}])[[
|
||||
(<((<((<<([((<<>()>(<>()))<{<>()}([][])>)[[({})<{}<>>]]])>(<{(({()[]}(<><>)){{()[]}{()()}])}<({<()<>>({}
|
||||
[(<<<(<<{{({<[<>[]]([]()]><<<>()><<><>>>}[<[<>{}]((){})>(([]{}){(){}})])<<[{<>()}<{}()>]({
|
||||
([[{<[[<[{(<<(<><>)>({<><>}{<>[]})>[{[[]{}]({}{}))])}{(<((<><>)(()[]))><([<><>]{()[]})[{<>
|
||||
<<[[<{<<<[{[<(<>[])>{{{}<>}(()[])}][({[]{}}(<>()))<(<><>){{}()}>]}{{{(()<>)<<>{}>}<<[][]>>}[([[][]]{()()}))}]
|
||||
(([({{{<<{{{<[(){}]{[]()}>({{}()}({}{}))}}{([{()<>}<()>](([][])<<>[]>)){{<<><>>{()}}{<{}<>><[]<>>}}}}{[<[[[][
|
||||
[([{<{{[([<((({}{})[<><>])<{{}{}}<()()>>)>{(<[()[]][<>{}]>(<()[]>[()<>]))([(<>[])<{}{}>]{<{}()>[<>[]]})}
|
||||
[<<<[(<((<(<{(<>[]){<>{}}}{{<>{}}}><[(()[])(()())][<[]{}><<>{}>]>)>[({<[()<>]({})>})])(<[[({<><>}{(){
|
||||
{{(<({<<{([{[<<>()}<{}[]>][{<>{}}[{}{}]]}{{[[]<>]{{}()}}}][({([]{})<()()>}){{({}[]){()}}{{()}
|
||||
{({((({[([<(({()<>}[{}<>])[<<><>><()()>])<[(()[])<{}()>]{[[]()]({}<>)}>>[({<()<>)})]]<{<<{{
|
||||
<<({[([{[{<<<[()<>]{()<>}>{([][])[<>[]]}>{({<><>})[{[][]}<{}{}>}}><<({{}()}<{}()>)><[(()[]){()()}][<()<>>{[](
|
||||
[([<({<{[<[<<<(){}><{}[]>>([{}[]])><{<[]<>>[{}()]}[<{}<>>{(){}}]>][(({{}()}[{}<>]))(<{[]()}(())>{
|
||||
<<([(<(({{{[{(<>()>[{}()]}[<[]{}>({}())]]}<{({{}()}[<>{}])}{<(<>[])({}<>)>{<[]()><[]<>>}}>}{{[{[
|
||||
{<([<{{<(<({<({}<>){()<>}>(<(){}>([]{}))})>({{[([]())([]())]}<[[{}{}>[<><>]]{([]())<{}()>}>
|
||||
[[{({[<{<({[{{<>[]}[(){}]}<[<><>]{[][]}>][{{(){}}<<>[]>}[{(){}}[()[]]}]}{{(<<>{}>[{}[]])<{()[]}[<>{}]>}
|
||||
{(({{[[{{[([({<>[]}[[]<>])[{()()}<()[]>]]){(<{[]{}}{[]{}}>(<(){}>{[]<>}))((<{}<>>{(){}})<[<>()
|
||||
<{[<([[<{<[{{{()<>}<[]()>}{[()]([]())}}<<[(){}]([][])>{{[]{}}<[][]>}>]<([{{}()}[<>{}]])<[<[]<>><()
|
||||
({[<<[<{([{[({(){}}{()[]})<<[]()>>]<[{()[]>{()<>}][<{}>{[]()}]>}[([<(){}>(())])({[()()]<<>{}>}<{{}{}}
|
||||
[[<{[{{[{[[{({{}[]})}]](<<<(()<>)><({}{})<{}{}>>>([<{}<>>(()[])][<<>()>])>)}<(<<([()[]][()[]])<{()
|
||||
[{([(({<{<([(({}<>)[{}()])])><{[[{[]<>}<<><>>]<<[]<>><(){}>>]}{{<<(){}>{<>()}>[<{}{}>{<>[]}]}[<[()()]
|
||||
<[[[<({[[<{{<(<>())(<><>)>{[(){}][{}<>]}}({({}<>){{}[]}])}[[(<{}{}>[()[]])]{(([][])<()>)[({}())<{}()>
|
||||
{[[(<(<{<([[(([]{})[<>()])<<[]>[()[]]>](<{()[]}[[]<>]>{[()<>]([]())})][([<{}<>>[{}[]]]{<[]>(<>)
|
||||
<[<[[<<(({[(<[[]]{<>[]}>{(<>())(()())})<({(){}}{[][]})>]([{<()()><[]()>}[{[]()}[[][]>]]{{(())}(({}{})<<>[
|
||||
(({<{{[{(<[[[<<>()>][{<>()}[[]<>]]]]{{{{<><>}({}{})}{{[][]}({}[])}}{[{{}<>}{[]()}]}}>{<([[
|
||||
<([<{([([[{{[{{}{}}<{}()>]<{{}{}}>}({{(){}}{<>()}}[<(){}>[()()]])}[<{{<>[]}[()()]}{{{}[]}{[]<>}}>]]{[{<
|
||||
<{({{[<{<(({[({}<>)[[]<>]]<<[]{}>(()<>)>}))[<{((<>[])[<><>])<((){}][()()]>}{<([]{})(<><>)>}>{(
|
||||
{<<<<([{[<[{<<(){}>({}{})>}<<{[][]}{<>()}>({{}()}([]{})))]((({<><>}<{}[]>)({[]()}{<>()}))[[<{}{}>][{[]()
|
||||
[(<(<[(<{({[<(<>{})[()()]>[([]{}){[]<>}]]{{<{}{}>(<><>)}<{{}()}((){})>}}<<{{()[]}((){}}}{{
|
||||
{<<<[(<([{<<([()()][()])<{[]<>}[<>()]>>[<(()())<<>{}>>({[]{}}([]<>))]>}])>)([([{{{[[[]()](()
|
||||
<<({<{<([([[<[(){}]<<><>>><{()[]}[(){}]>]<(<{}[]>){[[]<>](()[])}>][<[<(){}>[{}[]]]({[][]}((){}))>
|
||||
{([{{[(<({{<(<[][]>{()()}){[{}()]}><(<<>())<[]{}>){<{}{}>((){})}>}}((<(<<>[]><()()>)><{[[][]]}<[<>
|
||||
[(<{{[{[{<([[[{}[]]<<>>]][[(()[])[(){}]]])({([<>[]]({}<>)){([]{})({}[])}}({(())({}[])}<{<>[]}(()[])>))
|
||||
({[([(<{<(<<(([][])(()()))({[]()}(<>[]))><({{}()}[[]()])>>)>[<[([{()<>}<[]<>>]([{}<>]{()()}})<[<{}
|
30
2021/day10/day10.py
Executable file
30
2021/day10/day10.py
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
if __name__ == '__main__':
|
||||
syntax_check_score = 0
|
||||
autocomplete_scores = []
|
||||
for line in sys.stdin.readlines():
|
||||
stack = []
|
||||
corrupted = False
|
||||
|
||||
for c in line.strip():
|
||||
if c in '([{<':
|
||||
stack.append({'(': ')', '[': ']', '{': '}', '<': '>'}[c])
|
||||
elif stack.pop() != c:
|
||||
syntax_check_score += {')': 3, ']': 57, '}': 1197, '>': 25137}[c]
|
||||
corrupted = True
|
||||
break
|
||||
|
||||
if corrupted: continue
|
||||
|
||||
autocomplete_score = 0
|
||||
for c in stack[::-1]:
|
||||
autocomplete_score *= 5
|
||||
autocomplete_score += {')': 1, ']': 2, '}': 3, '>': 4}[c]
|
||||
autocomplete_scores.append(autocomplete_score)
|
||||
|
||||
print(syntax_check_score)
|
||||
autocomplete_scores.sort()
|
||||
print(autocomplete_scores[len(autocomplete_scores)//2])
|
Loading…
Reference in a new issue