Browse Source

day 12

main
Luna Lailatova 3 years ago
parent
commit
353b229fbd
  1. 48
      day10.py
  2. 89
      day11-2.py
  3. 83
      day11.py
  4. 32
      day12.py
  5. 102
      input10.txt
  6. 10
      input11.txt
  7. 21
      input12.txt
  8. 10
      testdata10.txt
  9. 7
      testdata12.txt

48
day10.py

@ -0,0 +1,48 @@
import sys
class lines:
def __init__(self, inp):
self.line = inp
def solve(self):
counter = True
counter2 = 0
operators = ['()', '[]', '<>', '{}']
scores = [('(]', 57), ('(}', 1197), ('(>', 25137), ('[)', 3), ('[}', 1197), ('[>', 25137), ('{)', 3), ('{]', 57), ('{>', 25137), ('<)', 3), ('<]', 57), ('<}', 1197)]
scores2 = [('(', 1), ('[', 2), ('{', 3), ('<', 4)]
while counter:
counter = False
for i in operators:
if i in self.line:
self.line = self.line.replace(i, '')
counter = True
for i in scores:
if i[0] in self.line:
return i[1], None
for i in range(len(self.line)-1, -1, -1):
counter2 = counter2*5
for f in scores2:
if self.line[i] == f [0]:
counter2 += f[1]
return 0, counter2
inp = []
solution = 0
solution2 = []
with open(sys.argv[1], 'r') as f:
for i in f.readlines():
i = i.strip()
inp.append(lines(i))
for f in inp:
tem1, temp2 = f.solve()
solution += tem1
if temp2 is not None:
solution2.append(temp2)
solution2 = sorted(solution2)
temp3 = len(solution2) // 2
print(solution2[temp3])
print(solution)

89
day11-2.py

@ -0,0 +1,89 @@
import sys
class octopie:
def __init__(self):
self.temp = []
def format(self):
self.y = []
temp2 = []
for i in self.temp:
temp2 = []
temp = list(i)
for t in temp:
t = int(t)
temp2.append(t)
self.y.append(temp2)
def tick(self):
for i in range(len(self.y)):
for t in range(len(self.y[i])):
self.y[i][t] += 1
def flash(self):
pas = True
counter = 0
while pas:
pas = False
for i in range(len(self.y)):
for t in range(len(self.y[i])):
if self.y[i][t] > 9:
self.y[i][t] = 0
pas = True
counter += 1
if t == 0:
pass
elif self.y[i][t - 1] != 0:
self.y[i][t - 1] += 1
if t == len(self.y[i]) - 1:
pass
elif self.y[i][t + 1] != 0:
self.y[i][t + 1] += 1
if i == 0:
pass
elif self.y[i - 1][t] != 0:
self.y[i - 1][t] += 1
if i == len(self.y) - 1:
pass
elif self.y[i + 1][t] != 0:
self.y[i + 1][t] += 1
if t == 0 or i == 0:
pass
elif self.y[i - 1][t - 1] != 0:
self.y[i - 1][t - 1] += 1
if t == len(self.y[i]) - 1 or i == 0:
pass
elif self.y[i - 1][t + 1] != 0:
self.y[i - 1][t + 1] += 1
if t == 0 or i == len(self.y) - 1:
pass
elif self.y[i + 1][t - 1] != 0:
self.y[i + 1][t - 1] += 1
if t == len(self.y[i]) - 1 or i == len(self.y) - 1:
pass
elif self.y[i + 1][t + 1] != 0:
self.y[i + 1][t + 1] += 1
return counter
octo = octopie()
solution = 0
passs = True
with open(sys.argv[1], 'r') as f:
for i in f.readlines():
i = i.strip()
octo.temp.append(i)
octo.format()
octocount = len(octo.y) * len(octo.y[0])
while passs:
octo.tick()
checker = octo.flash()
solution += 1
if checker == octocount:
passs = False
print(solution)

83
day11.py

@ -0,0 +1,83 @@
import sys
class octopie:
def __init__(self):
self.temp = []
def format(self):
self.y = []
temp2 = []
for i in self.temp:
temp2 = []
temp = list(i)
for t in temp:
t = int(t)
temp2.append(t)
self.y.append(temp2)
def tick(self):
for i in range(len(self.y)):
for t in range(len(self.y[i])):
self.y[i][t] += 1
def flash(self):
pas = True
counter = 0
while pas:
pas = False
for i in range(len(self.y)):
for t in range(len(self.y[i])):
if self.y[i][t] > 9:
self.y[i][t] = 0
pas = True
counter += 1
if t == 0:
pass
elif self.y[i][t - 1] != 0:
self.y[i][t - 1] += 1
if t == len(self.y[i]) - 1:
pass
elif self.y[i][t + 1] != 0:
self.y[i][t + 1] += 1
if i == 0:
pass
elif self.y[i - 1][t] != 0:
self.y[i - 1][t] += 1
if i == len(self.y) - 1:
pass
elif self.y[i + 1][t] != 0:
self.y[i + 1][t] += 1
if t == 0 or i == 0:
pass
elif self.y[i - 1][t - 1] != 0:
self.y[i - 1][t - 1] += 1
if t == len(self.y[i]) - 1 or i == 0:
pass
elif self.y[i - 1][t + 1] != 0:
self.y[i - 1][t + 1] += 1
if t == 0 or i == len(self.y) - 1:
pass
elif self.y[i + 1][t - 1] != 0:
self.y[i + 1][t - 1] += 1
if t == len(self.y[i]) - 1 or i == len(self.y) - 1:
pass
elif self.y[i + 1][t + 1] != 0:
self.y[i + 1][t + 1] += 1
return counter
octo = octopie()
solution = 0
with open(sys.argv[1], 'r') as f:
for i in f.readlines():
i = i.strip()
octo.temp.append(i)
octo.format()
for i in range(100):
octo.tick()
solution += octo.flash()
print(solution)

32
day12.py

@ -0,0 +1,32 @@
import sys
inp = {}
solutions = []
def juzgfvzgv(poi, path, twice):
nex = inp[poi]
#print(nex)
for i in nex:
if i == 'end':
solutions.append(path + [i])
continue
elif i.islower() and i in path:
if twice and i != 'start':
juzgfvzgv(i, path + [i], False)
else:
continue
else:
juzgfvzgv(i, path + [i], twice)
with open(sys.argv[1], 'r') as f:
for i in f.readlines():
i = i.strip()
temp1, temp2 = i.split('-', 1)
inp.setdefault(temp1, list()).append(temp2)
inp.setdefault(temp2, list()).append(temp1)
juzgfvzgv('start', ['start'], True)
for i in solutions:
print(i)
print(len(solutions))

102
input10.txt

@ -0,0 +1,102 @@
{([[[(<<[{[[[[(){}][()]][({}())]]]<{((<>[]){[]<>})({()()}(<>[]))}<{{{}()}{[]()}}>>})[<(<[[<><>][{}{
([(<(((<[({{({(){}}<{}()>)((<>{})[{}<>})}}[{[(<>())[[]]]{{[][]}(<><>)}}{<<{}()>([]())>([<>][{}])}])](<[{[
{{[[<[<(<<<{((<>[])([]<>))(<{}><()[]>)}[(((){}){<>[]})<{(){}}<<>[]>>]>{[{{<>{}}<()<>>}<<<>[]>([]<>)>][
<[{<(({([[([({{}[]}{<><>})<<[]{}>>]<<<{}{}>((){})><{{}()}<{}[]>>>)](([<([]{})<{}<>>>(<[][]>{()()})
{{<(([<[[{<{({{}<>}({}()))<[<>[]](<>[])>}><[(((){})){[()]<<>[]>}][{{<><>}(<>{})}<<()[]>({}())>]>}<[{[(()<>)
[<{{{({{[<([<{<><>}{<>{}}><<[][]>[{}<>]>]({<[]{}>[[]{}]}{([]())([][])})){<{[[][]]([]())}>([[[
{[<[<<([[<(<<<<>>({})>><({(){}}(<>{}))[{()()}(()[])]>}[<({[]})<[()[]](<>{})>>[<({}{})[()<>]><{(){}}>]]>
[(<({{<[{<(<((<><>)<[]<>>)({<><>}<<>()>)><<<()<>>[()()]>{<<>{}>[()<>]}>){{[([]{})<<><>>]([<
<<{{<{<{([{(<{<><>}>((()[])<<>{}>))({<{}>}<[[]()][<><>]>)}<{([[]()]{<>{}})}{(<<>()>{<>{}})[{<><>}{<><>}]}>]
{(<{<({{([[{<({})[()()]><[{}<>][{}[]]>}<<<[]{}>[<>()]>({{}{}}[{}[]])>]<({[[][]]({}())}[(()[]](<
<[<{[<<[(((<([()()]<()()>]([()[]][{}{}])>)[[[{<>}[<>[]]]][(<()()><<>>)<<{}{}>{<>}>]])([(<({}<>)[()()]>
(<<{{([<[<[<[{[]()}[{}<>]]<(<>[])[{}]>><[{()[]}[()[]]]<([]<>)(()())>>]{{{{()<>}{()()}}[(<><
<[([(<[[[(<[(<{}()>{()()})<<()[]>{(){}}>]><<({[]<>}<{}{}>)[{[][]}{[]{}}]>{<{()()}(()[])>{[<><>
[[([[({{{[[(<<()()>[<>[]]>)<[<<>{}>]([[]()][(){}])>]<(<{()<>}[[][]]>(([]{})[[]()]))[<({}[])
<<{[({<[[[[[{<<>()>{<>{}}}[<()()>]](<<{}<>>{{}<>]><[{}<>]<()<>>>)][((<[]{}>[[]])<{{}()}>)[((<>{}))<<<>{}>(
[[<[[<<(({{<({[]<>}([][]))>{([[]()]{{}<>}){[[]{}][()<>]}}}({{({}()}[[][]]}(((){}){<>})}(<[{}<>]{()()}>
{[{<[[(({<({[{()[]}[[][]]]}(({<><>}<{}[]>)))>}{[{(<{[]{}}{{}[]}>{<<><>>})}<{{[[][]]{<>()>}}<{
{[({<{<{[[([[<()<>}{[]<>}][<<>[]>([])]])]([({{[]()}({}())}([<>()](<><>)))])]{{<[<<[]<>>(()())>(<<>()>{<>
({([<({((<({<<()<>>[(){}]>[(<>{}){<>[]}]}){([{{}[]}])([({}()){<><>}]{[<><>]([]())))}><<[([{}[]])](
<{[{<{<<[<<<[(()<>){[][]}]([()<>]({}{}))>{(<{}{}>[<>{}])[{{}()}[(){}]]}><({<[]<>>[<>{}]}{([]<>)<[]{})})<([{}(
<[<<(({<[{{(<[[]<>]<<>()>>([{}<>]{[]()}))}{<(([]<>)<()<>>)[({}[])<[]{}>]><<<{}[]>{{}<>}>({<>[]}[(){}])>}}<(
[[[[[[(((<{<{(()())<<>{}>}>(<[<><>]({}[])})}{{<[()<>]<[]{}>>[{{}<>}[[]()]]}({<<>[]>}[<{}<>
[(({{<{[<[[(<(()())<<>()>>[<<><>><()()>])(<[{}()]><{[]()}<{}{}>>)][<[({}())<{}<>>][({}[])(()[])]>(((
(([<({{<{{[<<{[]()>(<>{})>[[{}]{{}{}}]>{<<[]{}>>[([][])[<><>]]}]<<[<<>[]>({}<>)]({<>[]}<{}{}>)>[{<{}<>>{[]()}
{(<<[{<<{({(<(<>{})(()())><(<>[]){[]<>}>){[(<>[]){[]()}]{[<>()][{}<>]]}}{([[{}()]]((<><>)))[([{}()]([]()))
[{({[[{{[<<{{[{}<>][<>]}([(){}]{<><>})}><(<[()[]][{}{}]><{[]{}}({})>)(<({}[])<()()>>{<{}{}>{[
([(({{<[<(([({{}<>}[[][]])<({}[]){{}()}>]{[[{}[]]][((){})]})<[{{{}<>}([]{})}{{[]<>}}]>)[{{<([]())({})>
<{{{<<(<{<(<{{<>()}}{({}<>)}>)>}((<{[<{}{}>([]<>)]<<[]()>[{}()]>}<{[<><>]<[]{}>}{{(){}}[[]()]}>>[({(()<>)<{}
((<[{<<{{{([[[[][]](<>[])]]{<({}[])([][])]<{{}{}}{()[]}>})}[[{<{<>[]}{<>{}}>}]]}{<[[((()<>)<()[]>){<()>({}[]
({[[{<{{<<([(<[]<>>{<>{}})<{()[]}(<>())>])<[{[<><>]({}{})}][<({}())><{()<>}(<>())>]>>>{{(([
<((<<(<(<<{{{[{}]<()<>>}{[[]<>]{<><>}}}<[[<>{}]{()()}][<()()>{[][]}]>}{[{[{}()][{}{}]}(<{}()>[{}<>])]}>>
(([<({<[[(<(<([]())({}<>)>([{}()]{<>[]}))<{{{}{}}([]{})}<({}{})<{}<>>>>>[{{<<>[]><<>{}>}({{}<>})}{({[]()}(()<
{[((<({[([(([{(){}}{{}()}][<[]()>{(){}}])[[[{}[]]{{}<>}]<{[]{}}>]){(<[<><>][[][]]>)[{{<>{}}((){})>[([]())[
[[<[<{({[({{([()<>]<()()>)}[<<[]()>>]}((({()()})(<{}>[<>()]))[(({}{}){[]}>(([][])<()()>)]))[{<[<[
[<<([((<<(([[({}{})((){})]<({}[])[{}{}]>]<{{<><>}<[]>}>)[<{{<>()}<()()>}{<<>{}>[[]()]}>[(([][])
{(<(<[[((<([{<[][]><()>}[[<>{}]]]<<((){}){[]())>[<()<>>(<>[])]>)<{<[[]][<>{}]>({<><>}[<>()])}({{{
(<{({({<[[((<<{}<>><<>()>>({{}}<<>[])))[<<{}[]><<><>>>{{[]{}}(())}])[<[([]())<<>{}>]>[[[<><
<[{[[{[({{{([<()()><<>[]>])([([]{})(<>())]{([]<>){()[]}})}<{({{}<>}{[]})([()()])}<[[[]<>><<>{}>]<[()()]<(){}
<<[<[{{({(({(<[]()>({}{}))([{}[]][[]()])}{{(()[]){<><>}}([<><>]{{}})})[{[[{}{}]({}())]{<<>{}
{{{[[[[[<(<<{(()[]){()<>}}<<(){}>(()())>>({(()[])}<<[][]>[<>()]>)>)[{[<(<>())>{<(){}>[{}{}]}]
(([<[[{(([([<<<>{}>((){})>[({}{})<()<>>]]([((){})({}())]])[[{[()()][()[]]}([[][]](<>()))][<{()<
([<{{[[{<{[({<()[]>{[]<>}}([()<>]<[]()>))]}>{[<({({}{})})>{{<[<>{}][()<>]>({[]}{[]<>})}{<[[]{}](<>())
[{<<<{{((<{<<{[]()}<<>{}>>{((){}}{()()}}>}{[((()<>){<>})]({{()()}{(){}}}(<<>()>))}><[<{<{}><(
(((<<<<{((((<{<>[]}{<>()}>)(((<>{})(<><>))))))}><<{<(<<<[]{}><[]>><{[]()}{[]())>>{{<{}<>>}{{
{{[{<(({[[[<[[(){}]]><<[{}{}]({}())>{{[][]}[()()]}>]<{<[<>{}][<>{}]>[(()[])<()[]>]}[{<{}<>>({
{[{{[<[(((([{{{}{}}}({<>{}}[[][]])]){[<([]<>)([][])><{()<>}([]())>](<({}<>)<()>>(<()[]>{{}()}))
{{[(<<[<{<{[[<<><>>[()()]]]<(([]<>))<[[]{}]<[]>>>}>}>{{[<<<[()()]({}())>{<{}()>(<>[])}>([[(){}]<{}[]>]({(
[[[<<(<[{<[[<{<>[]}{{}[]}>]{({<>{}}[<>]]<({}{})[<><>]>}]((([{}{}][{}<>]))[({<>()}(<>{}))])
{{((<<[({<<<{[(){}]({}())}([<>{}]<(){}>)>([(()<>)<{}[]>]<<[]{}><<>{}>>)>[[<{<>}((){})>[{()[]}<{}<>>]](
((<<<<(<[{((<[[]{}](<><>)>{(()<>){()[]}}))}{<({(()())[(){}]}[[[]<>]<{}<>>])<([()[]])[{{}{}}{<><>}]>]}][<[{{
[[({<{{([([<{<<>()><()()>}>((<{}<>>{<>{}})[(()<>)[{}[]]])])[{{(([]())[<><>])({<>[]}(<>{}))}[[<[]><<>[]>]({[
[[(<(<[[(<{(({<>()}(<>[])){<<>[]>{()}}){({<>()}((){}))<<{}[]>[<><>]>}}{({<<>[]>[{}<>]})[[{(
({[<({<{<(<({([]<>){{}[]}}<({}{})[{}{}]>){{([]<>){(){}}}(<[]<>>{<><>})}><[[(<>())]{([]<>)}
{{[[[<{<(<{[(({}[])({}{}))<<()<>>>][<[{}{}]{()[]}>(<[]<>>{<><>})]}<{[<<>()>]<([]())<<>()>>}>>)
(({{{<(([[<(<((){})><[[]{}][{}()]>)<{[{}{}]}<(<>[])>>>]])({{{<[<()<>>{()<>}]>([<<>{}>(()())]<<<>{}>{[]}
{{[[[[({<{[{<[()<>]<<><>>>({<>()}<<>{}>)}(({[]<>}([]))<<<><>>[[]<>]>)]<(<<()()>([]<>>>{({}{}){()()}})[[[<><
[<<{[[([(<{[{{[]()}{[][]}}{{[]()}{(){}}}]{{[{}<>]([]<>)}(<{}()><<>()>)}}<[<{{}<>}<[]<>>><[[]{}]([]{})>][{({
[[[<<(({(<<((<{}<>><(){}>)<([]<>)(()[])>)[((<>())<(){}>){{(){}}{<>[]}}]><<({(){}}{{}<>})>{[<[]{}><[]{}>](<()
({({{<[<<<[{{<{}[]>[(){}]}{(<>[]){{}}}}]{[[{[][]}{[]<>}]{(())([]{})}](<({}{})(()())><{<>()}>)}>>>]([({
<[(((<{<{[<{{{[]<>}{<><>}}{([][])[<>()]}][[[()<>]<{}[]>](({}<>)<[]()>)]>][(<{{{}[]}((){})}{{<>{}}({}()
{<{[({<<(<[<([<>]<[]()>)<({}()){()[]}>>([{()[]}[{}{}]])]>(([{[[]<>][[]<>]}[[<>()]<<>()>]>(((()[]){<>{}}){
<(({<{[(<([(<{[]{}}{[]()}>){{(<><>){[][]}}[{{}()}<[][]>]}])>(<{{{[()<>][()<>]}({{}[]}[[]{}])}}(<{{[]{}
{<[<[{{<<<([[[{}[]]{<>[]}](<<>[]>[()()])][(([]<>)]])>([[<{()}{<><>}>[(<>[])<{}()>]]]{<{<[]{}>[[]
([{[[<<<<{<[({[]{}}(<>()))[<{}<>>[[]{}]]](([{}<>]){{[]()}[<>[]]})>[{(([][])[{}[]]){(<><>)(<>[])}}(<{()<>}
<<(([<{[((<[(<(){}>[<><>])[<<>[]><()())]]{<{()[]}(()<>)>}>)[<<{<(){}><{}()>}{[{}<>]<(){}>}>><[<{<>[]}{[][
(<<[<{<(<<({<([]{}){[][]}>{<[][]>{<>{}}}}[(([]())<<><>>){<{}><<>[]>}])(<{[<>[]]}>{<[{}<>}{<>{}}><{<><>}{()[
[[[[{<[{[<(<[(()())<{}[]>][(()())<()>]><{{()()}[<>{}]}[({}()><[]<>>]>)<{{[[]<>]<[][]>}{[<><>]
{{<(({{<{(<([<[][]>(()[])])<<{<><>}<[]<>>><(<>{})>>><{[[[]{}]{<>[]}](<<>{}>(<>[]))}[[<()<>><()<>>]<{()<
<[({<[[[(<{[(<{}()><(){}>)(<[][]><<>{}>)]<<{{}[]}<{}()>>[(<>())<<><>>]>>{<[([]{})[(){}]]{[(
[{<<<({<[[[<{{<>{}}<()<>>}{[[]()][(){}]}>{(({}[])<[]{}>){<()>(()[])}}]<{<({}<>)<{}[]>>[<{}{}><<><>
{<<[(<<<(<[<<{<><>}>({<>()}(()[]))>[([<><>][[]{}])(([]<>))]]>)>[({[<([[][]]({}))<((){}){[]<>}]>[[
([<{<(<<{({<{<(){}>({}<>)}}{<[{}()][()<>]>{<[]<>>{<>[]}}}}<({[{}{}](<>[])}(<[][]>[{}<>]))<
{([<<<<{[<<[[<{}{}><[][]>]<{{}()}[()[]]>]<[(()[]){<>[]}][[[]()][()<>>]>>(<[{<>()}(<><>)]{<<>{}>{
[[([(([[[<[((<()()>)([[]{}]<[]()>))]><{{[[[]{}]([]{})][(()<>)<{}<>>]}([{()<>}]{[<>()][{}[]]})}
<<{<[<<<({{(<<[]>([])>{<{}<>><<><>>}){<<()<>><()<>>><(<>[])<{}<>>}}}{([{[]<>}{<>{}}](<()()>[{}{}]))<{<[]>
[{{(([{[<{<{{<<><>><{}[]>}}{<(<>{}){[]}>[([]{})[[]{}]]}>(({[{}]<()[]>}))}><<[{(<{}[]><[][]>)
[[[<[<[{{[<[{([]())[()[]]}{<{}<>>[()[]]}]<<{[][]}<()[]>>(<{}<>>{[]{}})>>{<<<{}()>><([]<>)[<>()]>>{{(
{{{([{({[((((([][])[[]()])[(<><>)[()[]]])[[[<>[]]{{}<>}]<[{}[]]([][])>]){[[[[][]]<()<>>](<{}<>><{}{}>
<<<[({{(<((<<{{}()]<()>>(<(){}><<>{}>)>(<{<>()}<[][]>><{<><>}{[]()}>))[(<([][])[<><>]>(<()()>{{}
<[(([[(([[({[[[]()]{()()}](<<>{}>)}){<{{<>[]}{{}{}}}{<[]()>[{}{}]}][(<()[]>[<>[]])((<>{}))]}]{[<<<<>
({{[{<[{([[({[(){}]}[{[]{}}<(){}>])<<({})[[]()]>>]<(({(){}}<[]>)<[<>{}}(<>())>)>])}<<<<[[[[]<>][{}()]]
{{{[[([<{({{{<(){}><{}()>}([()()]<<>[]>)}<<[<>()]{{}<>}><<<><>>>>})([(<(()[])({}<>)>([{}<>](<>[]))){(<<>>
<([([[<{{({{[[<>[]]({}[])]}(<({}())><[<>{}]>)}{[(<{}[]>(<>[]))([[]{}]{[]})]({([][])(<>())})}
[({({{[{<{{(([{}]){<{}[]>([][])})({[[][]]<<>[]>}[<()<>><[]>])}<<<<{}{}>{[]()}>({[][]}[()()])>({([][])[<>{}]}[
({<{(<([<[{<{<<>[]>({}{}>}([()<>]<[]<>>)>({{(){}}<<><>>}[({}{})])}]><<[(<<<>{}>([]())>)[[<[]<>>(
<[{<{<<<({[([({}<>){()()}][<()()>(<><>)]){<{()[]}<<>[]>>{{{}()}[<>[]]}}](((<[]()>{<>()})(({}<>)([]{})))({(
<<{<[[[<[<[[({()()}({}[]))[<()()>[()<>]]]]>][{[<<({}<>)[[][]]>{{{}[]}<()[]>)>]<{{[()[]][[]()]}}{<[
<{<{({({[{<{[{()<>}]<<<><>><[]<>>>}[{<[]><(){}>}<{[]{}}(()<>)>]><{<{{}()}{(){}}>{<()<>>{[]()}}}((([]<>)<<>
{(({[([(((<<([()()]<<>[]>)[<<>()>(<>{})]>[<<<><>><()>>]>[((<()()>((){})))[[<()<>><()()>)({{}[]}
<[<[<{<[{[[([[()()]<{}<>>]){[[{}[]][<>()]]{[[]{}][()<>]}}]]<[{((<>())[[][]]>}([[()<>]<[][]>])](({[
((<<[[{<({[([{<><>}[<>{}]]){(([]{}){(){}})}](<({{}()}<()<>>)({[]()}[[][]))>{{{{}()}[[][]]}<(<>{}){<>[]}>}
<{{{[([({{[(<<[]<>>[{}<>]><<[]{}>(())>)<[[<>{}]<{}<>>]<{()}<{}{}>>>]}{{[<(<>{})<[]()>><[(){}]>][{([]())}[<
[{<[<(<<{({[[<[]<>><()()>]([()()]<<>{}>)]}{(<{[]()}([]<>)><{()[]}>){<<[]()><{}<>>>({()}<<>[]>)}})}{
[{(({[{[{(<[(<[]{}>(<><>))]<[{()}({}())]>><<[({}[]){<><>}](<[][]>[()[]])>[[([][])([]<>)](([]{}])]>)}]<[<[
<({[([(<(((({(<>())<{}[]>}[(<>[]){()[]}]))){[([([]{})(<>()]]([()()][{}<>]))<<{{}}(<>[])>{{()
((({{({<{<({[(<>[]){()()}]([{}[]][{}{}])})(<<{[]{}}>{<[]<>>{()[]}}>)><{{{{{}()}}{[{}[]]<<>[]>}
(<[<<[([[{<[<({}()){()}>(<(){}><<><>>)]>{{([()[]]<<>()>)(<[]<>>)}{[{<>[]}[<>()]](<<>()><()[]
((<<({<((<(<({<><>}({}<>))({{}{}}(<>()))>((([]()){(){}})[(()())(()())]>)>){{<([{<>()}(<><>)]<{<>()
(({(<[({({([<{[]()}<<>()>>{(()<>)[[]()]}]{{[()()]((){})}{[{}<>]{(){}}}})}<<<(<()()>[{}{}])<([]{}){{}[]
{({[[{([[[<((<(){}>{{}()})[(<>{})])([[<>[]]<()[]>][(()())<[]{}>]>>]((({[{}<>]<{}{}>})({<{}[]>}{(<>
[[(({<<{[(<<(([][]){{}<>}){[{}[]]({}[])}>(({<><>})<(()<>)[<>()]})>{({[[]{}]((){})}[([]())])})(({([[][]]
<[<{[<<<{[{(<[<>[]]>{{(){}}[[]()]})}[<{[{}{}]}><(<{}()]{{}{}}){({}[])}>]]}>[({{(<({}[])({}<>)>[{{}<>}])}{

10
input11.txt

@ -0,0 +1,10 @@
8258741254
3335286211
8468661311
6164578353
2138414553
1785385447
3441133751
3586862837
7568272878
6833643144

21
input12.txt

@ -0,0 +1,21 @@
TR-start
xx-JT
xx-TR
hc-dd
ab-JT
hc-end
dd-JT
ab-dd
TR-ab
vh-xx
hc-JT
TR-vh
xx-start
hc-ME
vh-dd
JT-bm
end-ab
dd-xx
end-TR
hc-TR
start-vh

10
testdata10.txt

@ -0,0 +1,10 @@
[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([([[(<>()){}]>(<<{{
<{([{{}}[<[[[<>{}]]]>[]]

7
testdata12.txt

@ -0,0 +1,7 @@
start-A
start-b
A-c
A-b
b-d
A-end
b-end
Loading…
Cancel
Save