From f1ed65a6d98b88b42db62ccf71e513b33a58cd2e Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Thu, 19 Dec 2024 05:24:17 +0000 Subject: [PATCH] day 19 part 1 --- day19/input | 402 +++++++++++++++++++++++++++++++++++++++++++++++ day19/sample1.in | 10 ++ day19/sol.sh | 8 + 3 files changed, 420 insertions(+) create mode 100644 day19/input create mode 100644 day19/sample1.in create mode 100755 day19/sol.sh diff --git a/day19/input b/day19/input new file mode 100644 index 0000000..d217520 --- /dev/null +++ b/day19/input @@ -0,0 +1,402 @@ +rwgw, ruwgb, urwbr, wu, uurbubr, gbbr, uwwb, rubgwu, wggwbwr, rugubuww, uw, rgru, rgrr, rrg, rbb, uurbrww, br, uwrwrwgb, bwbw, wgbu, wggu, urg, ugr, ugur, gurrbrr, ubgrruu, bb, rburguu, urgg, wggugggr, brww, bwwgr, wugub, grgg, ugw, grubw, gbwru, rww, wbu, ggwbu, ugurw, ggwb, uubuwgb, bbugw, rgg, wurr, bwbb, wburbb, rbrb, bbrwgw, gwbb, ubggr, gurr, rrr, rburg, uug, bbrubu, bwgu, gwug, guw, buwurgw, rruwggg, ubb, wwb, wbrg, wgr, wgrw, gubrr, rrwru, gbub, rbr, rwr, rubwu, ub, bgwr, gu, ggggwrbr, wrw, grg, rbuwu, bgbr, ugww, wrg, brwub, gruu, gbwbw, wubw, wur, grggwb, uuwuug, wug, rruuw, wgwg, uww, gbgu, rurr, gwguu, gwrwbw, guuww, rbugw, gg, uwbw, ubgrubur, wurrb, rgugurr, wrr, buggb, urwrb, ubuu, rgu, gwggb, uuu, uub, bruubb, bww, uwgb, rrubwg, ubwu, ugu, buwrrbwr, bbr, rbrww, ubuwg, bwwrr, gbwg, bw, gguugu, bgbbw, ggb, wrruuwbr, rug, uur, rgw, gbb, wuwg, r, guug, gwb, wbgr, bbbw, grwgwr, gwg, rurur, bubu, rguu, brb, ugbbbrr, wugrrr, bbw, bbru, bgrbubg, ubw, uruu, wgrgrwwr, bbwrugu, gbbbwur, rubbwbuw, wuwrwbu, brwbru, wub, rbrg, wwbwrbu, grbbu, ubbbwb, urw, gwuw, uu, urwugu, bgw, gw, rbwwwurg, gubr, bbu, rur, rburwgr, gwwgr, gb, rbur, rbw, ug, wurur, gbbrrb, ruuuwugr, wwrgug, gbrugu, wrww, wuwbgw, uwwwgrgb, gww, grwwu, ggu, rrurr, bgr, ubugwu, wwgwur, urrrbw, bwr, wrbgbu, wrwbb, gug, bwu, ruurw, rw, wbb, bbwgwrr, wgg, ugwu, wr, wwwr, w, wbwbuw, guugg, bug, bbbb, brbb, brur, rbg, wuu, wurwgb, rru, urrrbugr, grr, rubu, uugrwbb, bgbrurr, wgw, gub, ugwwgr, urwr, wbwbg, wrrb, rwrgg, ggwgrgw, bwbu, uwb, rg, urr, brrur, wg, u, bu, ubbbrw, brgbbbbu, wgrgu, bgb, ubu, uugubg, bub, rwrr, gggbrw, gwwrww, grub, urgrgw, bru, wgwgb, wubrg, ugrwwbb, wbgwrru, gbwb, wugu, uwwwg, ubr, gwr, bguwb, guwbw, wrb, grw, gwwgbb, wbwwr, grbwub, ubg, bwbgw, rwu, uurb, rbwgur, ubbr, grrr, ubwg, rgwuug, rgb, grrbub, bwb, uwuuubg, wrugb, brurub, wurg, urur, uru, bwwrrr, urwub, uwr, brr, ggg, bbg, bgg, guuruuu, ubwb, uburgbb, gbgrgug, rbwr, uwu, rwwbuugr, ubwwg, wwr, brg, wruububu, bgbb, ww, wrgbu, ugb, gru, bbwgbr, brw, bwwbb, wbr, grbg, wbbb, brbrwwbw, gbgwrrub, wwu, wgb, rruruu, wuggr, urb, bwg, wbg, rbu, wwg, wuw, wrbbugg, rb, rrgrbrg, guu, bwwugr, rwrb, gwbrb, wrugub, ubbrwu, uggbb, ggr, wwru, rgbb, bbgbgrr, wuruw, gbg, ubbwrg, bur, wuwuu, bgu, ruwgur, gbu, wwuwb, ggbgg, ugrbb, bugw, rggrb, rrw, rgwru, ubru, grbbuw, wbrr, wruu, ggw, wbgguuw, rggrugw, gbgwwg, gwwru, gur, rr, wbgb, burbwr, rggu, wgwu, rwuug, gwrbr, wbbwbgb, wurb, gbbuggg, gbbgbg, ur, ugwwu, wgu, bg, urrbgr, gurwg, bbb, urrr, bwurbrr, gbr, gwurb, ugg, uwbbrr, buggr, rub, bwrgbw, uwbb, ububggw, uuwrbbu, rrrwr, ruwgub, bugb, wwrw, gwbg, wwwrrr, urgggwb, gwuwr, www, g, wgrg, wbuwb, grwrg, uuw, wuwgb, buru, rgr, rrgu, urbgb, wgrr, gbuwww, rrgrgw, rgbrg, gugbuw, rrb, rrgbug, ugwbrgw, rwuw, grugrrbr, gbgww, ruw, wubb, gr, ruu, ubbg, brgurb, rwg, gwu, ruwr, grb, uwg, wgww, bgbbrww, buu, rurbgr, rwbw, gwwr, rwwbbugu, grgbr + +rubbgwuwbrwgrgrgrbrbbubgbggrbwrurwuggggwrbrgwbrrwb +urwgurrubuguruwuuuruwbbgrbbuwrbwrruuuubbuububuubrw +gguurrubwbuwgrbrrurrgbgburbrrurwbrrrubburuggbbgb +rgbuuwwwgbbwgurrwurgwgrgrbbbuggwgwugbrwb +rwggurbrgwrrwuururwwubgrurwwrubgguububururwb +ggrgrruwwwgrwuubgrggbbwrrgbrwrwgwwububrubguurggbrwbg +ggurrgrggwrwruuwrbrgbrubrbuggugwgrwgwurbub +wwwwuburrwbwugguwuwgwwrbggbwuwuuuuruwwurbwurgbwbggrr +urburguuwwwgrbrbgbbgbgrbgbubguugwubugwgrruuuugbbbbgubggu +guurrgwububururwgugrguuubrwrguurbuuuugrgbuwru +urwuwuuguwwwgrgbuwbgubwuwuurwuwggbwgubrbrguurrgrwb +bwwbbwuwbubgrbbgwuubrrbwgbggubbrbbwrwuuuguugwrwbub +wwwguwbgrrgbrgggwrgwuuwwwgwgwrgbrbgwgwruuruguubruug +gruuwuwbugubrwbbubrubgrruubuwugurbggrrbbbbg +wurubbwuggrrurbwwgrwubgbwguurbrwgwwwgrwuuuggwbguwwr +ggbguwrwguguwubgurgggrguuwugbuwbwwgwburgbwwuwgbrwbub +gwugrwruguwuugubbbrubbwbuwwwrgburrbbguwbgbgwrwb +grgugwwrgggbbbubububwuggrrgwruwrubwbrbbgwrwrggbuwrururrrrg +guwgggwrwrggbgwrrubrwburbuuububrbwrrrgurwugwggr +wuwwugwrbbuuburuururuwwrggbubwwugbuwugbburrwuwbubgbw +ugbggwbgurubbwrgwgggggwggrruubrgrwrgugwwgurrrbwbrwwur +wurubwrrbbgruurbbgurbbubuggubrrwwgbgwrwuuuwrgwbbrbw +rwwbruubgwrrugggwubgwwubwruuwggwrbwwbbrrwb +ugwgbguggggwwbwgwwuggurbwwgrbbuwurugwwrrrgugburruwb +brrrugbwrwbwwurbgbwwuugrbwbrgwgrgrbgrurwgwurgwruuguwbrurwu +rruwrrbgubguurwwugurrgrwbbuuwuburrbwwbbrggwuwr +uuwrburgruurrbuwwguurwbwwbwggrbubrwuuwuuwrbbg +gbbrrwgggbwwggwgwuurubrrurgwgwgbwgubwggrrbggug +wrwuggugbrwuuubbgrbugubbgurgrrburgwrbugrwb +bbbwgbuwbgrgggugrugwwwbwgrrbbbuubuguuugwburrrwrggwrrruwug +urbwwguugwrgbrrrrrrrbbwggrrubwgwugbbbuurugggrg +uugrugurbbruubwgbwbbbwubbrbbgwuuuwggwwwuubrrrwuwubrgrbrw +wbrugrwrwrrgugwugrrugugwubugrrrwbrwbwrggbwurrbgubgwbgbbgrwb +uwwbbubgrrrurgwrbgurugwbbrbbburggguugbwbrbgwbubuwbbgubgwg +rrbwbrbruwurwbwgggwrguwbbubuwuwurwubgwbwwgbubggwbbubbrbr +wwrwggbwwwrgubwrbwuuwbuuuwbrgwwrbrbrguruwrwbrrgrugb +wwbwrrubbbgwurbrbubwwbbbgbrbgbwbbuggrurbrwgwbubguurrwrwwb +rwurrgwuugrubggwbuubrbuwrggguwbgrbbgrgbbuwggbgwrbwgwbuuru +gwrrugbuurgrrwgbggwggguwwrrbgrbwwrrgwwbwubwbwrgbrgbgwwbgu +brrrwbururwwrwwrrgbwbubgbwgrgwwruuuwgugrwwrgbubru +uugbwguruwuwubburrgbbgbbrwrrbubuguugwgwwbw +gwburgbrwgwwubugrrrbuwugrbbwrrguwrbgbbgrggggbwuuwwgwgbww +rwwwbgwuubugurwbwururgbwbwwrwubgwuuruurbwbwgbwwbuwgg +bwwwbuwwrwgurbbwbguwwgwubwuwgwwubbwwwuwuuubbwr +urugrwggbbrburugwggbwbbuubbrbguuggwurgbrbbbgrbwuw +bgrbrbgbgwrrwgugbubbgbrurwrrgbwbbgrwrwbwwb +gbwubwgurggwbbgwwgbrrubguwgwwbrgwgrgwwwgwwbruwrwbuurwb +wuuwrwrbugruurrrrgwurguggbgwubugrugwwuguwwruuwbrrrwwruggb +ugrugbrrwuuwrwuguggwwgggubuwrrbwrugwwuugwbburrbrwb +wrrggbggbrgurbwguurugbwgrgwwgbwbgrbgwrbrwb +bugubbrwbuwugwwrwbgwugbuuubrwbugwrugggbwwrbgbwuurgw +bwrrwbrruuuugugggwgrgrwwrwwgwwgrbggwruwrwwwgrurwgggwbbw +gwwuwbuwwgwuurwwwgbruwuugruuwrgbbwugwbbwbguguw +uwrwwrurwwuwwwuwuubbbwbbrrwwbrrgbwbwggwgwruurrwb +rguuugbrbgrbwbbrwuuwwubwrrwggrwrgwwrgwuubwgbbwubbwbgbrruwu +gbgrgrwgbbbrwgubugwwuuwrrgbwbwgbwuwrugrbururbwrwrwbubrr +ruwrgurgguuurrggrurbuurubrbbguwbbrrbuuuwrgrwb +guurwgbwrbuurrrbugrbgbbrurbubbuugrgbwugbru +uggbgwrrgrrubgbbgwubwurgbbugububwrwbrgwbbbwwrwb +gwwgbbrrurbwwwrrrbruurbruggbrgwbgurbrwggwbrgurbbbwubbuw +wbgrwbuguguwrbbuurbubgubwgwwbrrrrbugurgggbbgb +buurgwggbbwgrrbruwuwruububuubrrbrrwrgbwbbwbwwururbgurbrrgrwb +rbgggbwrugrgwrwgwurggbrbgwgwgwwrbubbrwrbbuurugrrgwbrggbu +grrbbbwwguwbruwggwruwurrgrbgwubbubggwuugwubuwrrugurwb +rrbububbrrbbuwwuuwggbbwuwuwwrwgwwgwgrburbgrgrw +uuurugrbrrgwbrrggurrbubbuwguwuwgrurwbrbgwurwurw +rwubrwbuuuwbggrbwrwgwwrgrbrrbbwgrrwrwrrgbruggwwwgbbrwuuwrg +bburuwbugrggrwggrwbgbbuurwubuuugrbrrwgwgbrggrgggwbuuwbwbuw +wrbrbugwgrbuwrubwgwuwugbrgbwrwrgwururwrrrggrgurrwb +rggrbururgwuuwgbuwuwrruguugwbgubuwrubuwbrggbggbggrwb +gwurbruwrrgrrwbbwuwbgwrgwubbbuburrgbwrwrwb +urbrugbrwurgrgbrruwrbbrgwbrrbrwurbbbugwuugrwguwr +brrgurwwrguuubrggbggwwbgbgrrwwbburwuwrrwggbwubrrbggugubu +rwgwwuugbwrwrguwrrbrgwrurbwurrggwuwuwbgwgwwguurgrwb +guggggubguggwugbgbbwwgurubwugrbwgububbggbbrwb +wgwrguwggbugwwgrrrrwgwwwwrwwubgugwugbwgwggubwubrwb +grwwgbrwbubbwrwwwubugbgrubuuwbgurwurrugbwrgrrr +uugwwbuubggggruwugrurguwwwbrggggggrwwwrbrgugu +rgubgwbwurrguwgwburwubgrgbubbrbrruugrugbgrwwru +wbwwrubbbguggwbuugrgwguruuggurwggrrbruwbwrgbuw +rgugbrwuurrrrrurubrrgguuwbrrwruggubbbubgbwguurburggbrwb +rbuuggwwurwuuwgubgrbrruwrburugurwuubbburrguuruwr +rwurwrbbubgrwgggwwwbruuubwrwuwuwgrgbrgrgbugwrubrrbwbwbwrwb +gwrgbggrwrgbbbuuggbgrrgrrrruurbrwuugbubgbwur +rrurrwuuwuguuwbububrrwugbwuurbbgguwrwrrgrwwgbrggrburwg +ubruwgwbrubwrgbbrbbubggggwrggrgwbgggbgrburuwrbbrurgrgbbww +wrwgubgbwruugwubbggwugbgwwugwrbruuuwrwbbrrrru +rwubrrgbwrbgrbrwggugbbuugrguruwwwugrgurwb +wrgruuwrgguwwbrurbbugbrgruwrgrwggrbwwbwbgwrbrwubwubrwb +bggwugbrbwbgugwuwwurrwrrrwrgrguwuwurwguggwbrrbugrwr +ugubbwurburwrrbbbgwrbgwuwgbubrrgwgubrubrgrbb +gbwuggwruuuguurrwuurubrbwwbbwwuburgwgwurbbubg +uubwugrgburwubbbuururrwrwrgwurbwrrwurrubrwb +urbrwgwbuugbrwgbugggbbwwbuguuubbubwbguuubgbrrbububrru +rrbwwwbgrgwgurwwuwrbgwrwgrruwbgwbgugurwgrbugrbgbrbruw +ugrwbgrbrburugwbgugwugurrgwgrgwwrbgguwgrwrwb +wwbgbrgrwgggrbrugwwrwrbgubgrwguwbwubwwbgguggbbrgugbugrbbr +ubrwgwuwguwbwgguugrrbwuggwubbwwrrurbwruwbuw +gubrwwrbbrwwbuugrbwwugbgwwbbbugwrgbwbwwbwguggb +rurwgbbggugrwbubugrrwugrubuwwwwrwububgwwrwgwbr +wgbbrbbubgrrwwwgugugurbrubbuwbgwwwgwwgwrbwbw +ubgubwgwrwbuubgbbgrwbubugbbbrugrgwurubwgubguwugrrbu +gruuuwggwwwguwwguubggbguguuugwugwwgugwrwb +wrwbrgbgurwgbrbgurbbbggrbgwgubwbbggwrbwgbbu +bggubwbggbgrrrrggwbwbbgrguurrrggwbgurgrgwbuwbwurg +wuwbggrwwwbubrbwgrgrwgbrurggwwwubwwgwgbwuwwuguuwwgggbb +rwrugrubggrbururrwuwurbrwbuuggrbrbuugrwubbruggrbwuuru +wbrgggbwgrwwubbbguuuugrburubbrbrrrwubwgwguu +wrugrwruurrbwwwurggwbbwbuggrbwuruugwrburrwb +rburbbrwwrwgwbrubgwgwrwgrbwurgubuguwwwruuggbbuwwwggrwb +gwuugurgwwwrwwgbrbwwugwgurwbbbrwuwwwgrgbwbbgbbgruwgwwgwrb +rruwgbbwwrugugugrwubgrguguuwggbrrbrbubbwugurbgbubb +uuubwuburgrrwuugububuuwwrwrgbwbbgwgubwwgwgubrrbgbruggbu +wgrwuruuurwwbrwbwgrrwwrgurrbubwrwbgwrggbrrgugbuu +ugwbrgbbbwrgrgwbrguwrbrrgggbbuubgwbwgbgrwbrrwrrrgbrbgg +rgrggguuguwgbgrgrrgwrbbwbgurrrgwbwwguwbgggrbugugrbrurwb +bbwuwgrbbbbwrbrgbrgbbbburgruggrrrrbwrbbrwb +wbwuuwrruwggubggbgwbwwbggwbgbrrruggbwrrrbrwrb +wuubruggbruggbwbwuuugwrrwuwrgbwwbwuwwwrrgwrr +uwwgrbuubwbwbbrwburbrggburubwgguuwbwgbwburggwrgbrwb +ggbrubuwuurubruuubrbrgwuubguwbgbgwrrubrrrwb +rwgbbburwggwwgbbbrruuurbgrgbggrbgruuggbrgggg +rwwbwgwgwwbrbugbuuwbgggggwgrurbgrgwgwrgbbbuugbbgruwgwwwbg +rbwubbwuugwggrruuuugbruwwwwuuuuurgbgwwwgwbggwgbrurww +rwguwwrgugrbuwrwwbbugurrrwubruwugbrwubrwrgrbggbgr +ubbbugrbugrwgwggbwugwwbgwguubugbggbggrbuuwwbbbbbwr +gburuuwbrwrguwbrubgbwgruuwrwgbrwbrwwgwbgwggw +ggwwwguwgbuwrggbugurrrwwwrbrrbgurbbbgbruwrwwrbgrwwbuugrwb +rgbgrbrrubwuggruuwbgggwguuwwwrrrwuwrrgrubbbgrr +uwwgrrbugrrbwgggwuruwuuwggwbgwggwrbbuwbrrruubuguwugbrurwb +brwruwruwggrrubrwugbgbwwuggggruubrruugbgurrgwwugrurbrr +rgbbrrrbubrgbbbuuggruuurguubwgwgrwwgrbbwruwwb +rrbuuwgbuwwwbggrgbuurrbwwbwbwbrwwubuurrggrbg +urgbuwuwwugbrbguugbrbbggwggwgburgwgrwgurrbwwgrbbgw +uubrrugwggwgwbgbbwggwrrwbruwbrwuurgwwugrwgrwg +rgrguwguwrgwwgruggbwwbugbruubgurgrwuwrugbbggbuwrrggrwuug +uwubrubgbbwrgbgugwwwwwubwwubrburbbuurgwrrbwbubrbw +rgrbbwggrbgrrggrgbububggwggwwwwbrubguwgbuwbruwgugrgwrww +bbrwwrwgbgbgbrwwubbrgwuruwbrbubrrburuurwb +uuwgwgubwwbburwgrrbwgwrugrbwwgbggrurgwbuwru +uuggrgwuguuwwrbwrbuwrbrbgbuburuwwbbgbggbbugwwbu +bwbgwgwbrbbbwwbwrwgwbwgurggguwugrubrubrbrbuwwuugubru +uwuwrgwuubbruurbbbururrurrrbrwggbgbbgwrbuwubgbrrgwuurwb +bwgbbrgbbbbuugurgrburrrugbuubgbbwwwwgbuuwuggbgwguubb +uubwbuurbbwgbrgruwbugguguwbubbgrgbbgwbubggrrbwrwb +rrrguwbgwuwwbrrwrrwguwurbgbrburrwgrrburgwbbrruwwrrwbwrb +rruguburbgwgrgbguggggrugrgwbwwbwrbggwwgbruwuwrwwbubgburgr +rurgbwbugrbrgbgrurruwbubugubbgwuubgrwgrwwwgwbwrwbbwb +bbgbwggwgbbwbuugrrubbubgbrbrgubrugugrwbrwwbg +gwgugbburwwwwgbwwubwrwrwuurruuwuwwurugrrrgb +wwwrrrgruwrrrwuubwbrrurwbwrwrwbwggggrrbwuwggg +gbwrwguguggbwwrrbwgwwbwgbbbgwbuwuwrgwwrgbwuurb +guguuugbrbgruwbwbubwurrwggrubruwwggbwwubguub +uubbrubgrwwwuwrwgugbwbgurgrbbrugbrurguwrwwbbuguuuburwb +gubbuuuuubbwubgrwwguruggrbrgrrubuuuurrwrwb +uwwgbgrgrbrrgrguwgubuuwbwgguwbgurbwugbbrgguw +buwbgrggwwubrgrggbwurubgrbuuuwurrbuwurbbbbbrubgbrbuwwwrw +uwbrrbbwwruurgrrgrwruruwuubrgbrwwgwbugrbbrggrbwwbgrrwb +rbwgwbrguubbbugwguwrgrgbggbrruggrwubrwbgbwwuuwrrgwg +rbrbbgwggwuuburggwwrruruuruggwubruwwbrurubwbu +rbubuuurbwrugurggbwwbugbguuuuuwrubbguwrwb +bbwbubwrbuwgubguwrwrwgbgrrwwruurwwrbugrrurwb +bbuguurruwrrbguuuugwrguubwuubrbggrwubgugbwbwrrurugrugrwb +gbuuwurrbrwwrubgurbuubugrrbwubuurwuwwwgbbgbrwbrrrubggrwbgwb +grggrugrrbruuwbbbrrugbbbbuwbrwurrwgbwbuwrwb +bguurbwgwgbgbgrgrbbwgbbwubbwggrbubrwrbrubrbrgrwbburwb +grrrbrrwubuuggrgrurruuwwubwuuwubrrbburbrwwggrwgurgwgggwr +wbgubuuubwuwbrububrbwgrugrrbrrwbugguwwuuugu +rrgwgrguwruwgrwwrbgrgbbbbbwrgbugbggbrrwb +gwbrrgrruurwurburwbgrbggruuurbrbwubguwgrrburbgwwwu +bwwbugbruwrrguubruwbruuwrrwuwbruwgrwgwruwurgrbgurgruguwbg +brgrrbururwguwbburgurgrggbgubuwgruuuurbrrrrwugg +uwrbugwwrwuwgwwbuugbuurbwwbrwwrgrbggbgwwwrbrbwrrubbgrugw +uuggwbwrrwgrruwgggbggbgbubgwgbugwwrggrgbrgrururgugur +bwwwrugrrgbggbggbwubburrgubgwgwwrbwwgwbgurw +gburbuurwgbwgwwgggwbguwuwruububuwububwuwbgg +gbwggbgguwggbgwwrurwggbuburwrrgrbgbbuwuuuwrggwggwb +gbbwwwgbgwurgrbbwbgguwrwrggguwbugwbrgbwurgwuwgrrug +rgbugwrgugwbbbgggrwgwubbbwuurbrbrwbrgrwuurwgrg +ruwbuwurgwbuwrrrgwbrwrrruwwgggwugbwwrgruwgwubbgrwrrrwu +brrbwbbgwwwuururbrbuuwwwuguwwburbrurwuwgbwrbuubrbbww +rrrwrwugurubugbubbgwgrggwbbggbrugwbwrbggburgbrwr +ubrggrgbgwgruggrgrrwbruubwrrurubrbgwrwbggbrgbbrgwbbbr +ggrbbggrurbrbruwwugwrbrwrrbwgbrwwgubwrbrrgrbbwwwruwggww +wugbrbgwwwwrbugbwwrrburuwrbruruwuuuurbuwwwbgrgbrwb +bbgbgruurgbubburgwruwgrwuuubbwbwgugwbrbuuwwgurrurgwwrrb +wwburbbgbwurubrbrurwwgrwgubbgwbgrguuugurbwuwbuwuwuru +bwrgbuwrrrbubbwugbbrrgwgrbbbuguugrwbrurwrugguubbrubuggrwb +rgrwugwgbuuwubwrguuburuuuwuwbgguwuubggrrbugrbugwbgwwubwwbb +wbwrgurwrwrgggbbgggwwrbrbgurggubbbgrgbwbug +rbwbuwgurbbbgwuubwbgrwwubwbbwbgggwurbbbgbuu +wbburugwgrwwwgwwrwrbubrwuwrbgbwgbbwbrrbwbubbwbruubgrug +wrwggwgwwuuubbgrrwggrguubrgurrwuurubwurggwbrbbbugwuuwubwgu +bggrgbruwguurrurrbwuuwgugbrbwbuwwgwrgurggwburbbwgbuw +wwwbbugrrwwbrbwwgwububbuggrgrurggrwgrurruggbburwwgwurwb +rbrrwubgrwrbrbrggwwrurrwbwrurbwgbubggbrrrwwrwb +wuburwgwrwuwggbwwrgwwwugbwbggrurgbrurruwburuugwrwb +gwbwurbrbuurgwwbuuurrubbbrbwgruwuwuuuugwgbbb +wguwrbrbrgbbbggbggbgbgwgwbrggbggwguwurwwbbwbrrrrbwrwgrwb +wwwbruruubrurbugrrwwuburubbguwwrrbbwbbbrgbbubuwrurugr +brurrgggruwgrburwuggugrrbwbuuwbwuubgurwubruwrgwurbrwb +gwrruuwbrbwwbbbuwbwgrgubgggggwubgugubrbgugwuuburubugruwu +uubwruurruwwbrwburwggugggrguuurrgbbwbuggbwbuuurbgrwb +ggwrurbgrwgbbbruuurbbuubrwururgwwbuuwgrgwrgbubugrbrrgg +gubrurubwbrgrwwgggwwbwwguubbgggbggwbwwrguwrgwuggr +rwwugrbggburrrrbgwwgwgrurbbrguwrrbbbruwubgrgbrrwb +bgrrrbbgrguwgwwgurwwwrwugwwgrgrrwwguugbbruruuuwburbbuur +gwrgubrbubbbbrggrrbgwuwwbgbbuubugwgrwubgbbr +bwwwgwguwrrguruugwwbwgrgrwwbbwbrrgwbburuubbugbbrgggw +wburrbwwgubwbbwrbrgrwrbwugwuwwgwuugwwwgurgrguwuwgrgruu +wggrrrbgbgwurwrrwbrubbwbrwgrrwuugbrwwuwgruwwurw +rrbwggggurwrbwrrwubbrrurwwgbbrwuuwrruuwbrwb +ugwwwrbrbugbgrbuwbubwuggbwwugbgwrrwurrrwrrbgwrub +gbwgguuguuuugwgbuubggwuwbgrrbrbgwwbgugguruwrwggwwrwgwgu +wuubbbugwgrugububgrbgwugrurruwbwrbggwbgbbgurgrgbw +gwugwbbrwbwgwrwbrgurbwuwuugrrrbwwrburubgwrwwbbg +wwrgrrbubbuuwwbuwgrrwrrgggguwrrubbugrgwwbbug +gwubbruruuuwbbgrugbbbgbgwurwgwgwbwbwugggugbwuburwb +grgwgwrugugbgbwwbwubgwgbrgwguuwrrwwwugbgwgbgwruwwrwgwwrwb +rwrggugrwbbwgbubuwuwrrrgguguwrggbwbbwrrwb +rbgbwuwbwrbbwbbgugwgbbbwbrrrugwbrbubgruburwgwrrwb +wrrgbbbbwwuwgrgrrrbgurugbuwuubrgbgrbbbrrwb +ggrbwgwgrugrbrrwgugwguuwubuwwrugbbwwbbwuwggwuu +rwuuwwbugruwrruubuwuruuwubrugwrrwgruwrwrubbruruuwwg +rwrwuwbuwugbubgbbrguwgubuubbuwbwbgurubggbgubgwu +ugrrrruuwruuguwggubguwwwgrwuuwrwugwruwgrrbbw +ggwgwgurwrggrrwgwruuguwrugubrbuurwwruwbgrgrwb +rwbrrwuwbbbgbrrbwburwbbgbggwbbggwggugggrrrwbugg +ugbruwrruwgrbwuggrwwbruwwubrurrggbubgubugbgruugrrwb +wwwuubbwubwrubgubwrugrurbugguurburrrrwgguwwuggugurguwurwr +bwwbrruwbugbwguubbgggbrwbbrurgwbrwgggbgugbbgrbww +brgbwwubgubguwugwwuruubggwwuuwgwgwggbbwwbubbbggu +rbbrbbrurbuwwwguggguwgwggburbggubuwwbrbbubruuwwbgbru +rwuuugbwgwuugurbwrrwwbugbggbuururrbgwbwuuurggrurbgwbgggrrwb +bbgrgwwugwbwugggbugbgubgbgwbbuwrruurbwurwrgwurwb +bgwgguuwggrbbugbgwwwrwurrrbugrgguugrbgwbgwgwggruwwggwwgrwb +urrwggrubuwgbwggbbuwwbwbbwwrrgwrwbgurwurru +uwwbugruuuwggrrrrrbrrrbrurgwrrwwrrwbwbruwbbbuggwuu +wrururubbrugbggubggrbruuuubuubwuggggwwwubbwbbwbgbgbbgurwb +ubrubrbrgugurbuwrwuuwgbgwwrrwrrbbgwgbwruwrrrggggr +rbwguruwbgbgbbbbubbrrrugrruggurwwgrrrbrwb +rurgwubwbwgubwrbgguugrruururgwgbuwwurgugww +bwugrgruugguguwbgrbbbwuuwrrgwrrwrrubgrbrgbrggbww +rrgwbrwggbbgrggugurwgrgbrgwgbwrruwgwggwgrwuwrwbburwwbu +uurbwggwubwgwwguwbbgwwggugrrruggbgwbrrgwrr +grwbwbwrgrwrrubbbgwgrbbwrbgrurwrguwwwwggrbwbrwubbwrggr +gbuwbugrgubbrrbwwrbgwuwrwrbrbrwwbwbwrwuurrruurwb +ubrwurrrwwrbgwwgguubuwwgwbguwggurwbbgrugwbbrubug +rbugbwbguwggwwrwbbgwwuuruwwbrububbrurbubrgwwrbugugwbubggru +uuguruubgwwrrrwwugwurbgwbubrgrurrgwuuuuuggwbgrwbugu +gwwbugrrburuuwbwwbbugguubuuwwbuwbuwgubuwbruuugrgurgbuuubbw +ugwwgubwubbrubbrugbbbrurwgrgubgubugururgwgwwburgr +uggrgbruwrrbwrwgrruurwgguguwrwrwgbrggububgwrbguwbugwwguw +gruruurbgwrggggbrrugrbrgubrurrgugbbgrbgrwwugbrubw +ruggggwgbubuuubbgbburuwwgbbugrwubbrubgbrgbggrgubrb +wrguwbuwbrrbbbwbwrbgrrubwggbuwrrrgugbbrwbrguugrbrwgbrgg +rrgrwbgurgbbrgrbgugwrgrruruuugrgrrbbrrrwb +uuggrwugruuggrurbwggwgrwbwrgrbbbgbwbubugwg +rwwwrwrrbgrrgrgrwrgururgwrwburubwgrguwbuwwrrugugbbrwb +bbgguuwwuwbbuuwgwgurrwrwgbbrgurwgbrrbwrwbrwrbuggbwwrwrbuw +wrwwbgwgwruwrubbwrrwurwubgrrwrggbbgbbbgwwbgwggrbbwbrbbgbg +wgggrbrbwuwgubrguubgrguwrwuuuwbwwubuuwgbgrgbruubb +uggrwrwwbguwurbbburrgwgwururgwrgruwbwuubugubrurbuubrwrbuurwb +wrugguwugrgbuuwrbugrubrggggwwrbuwuurbuwruwwuww +wugwrwbbbrbbbrggrwbuwrwgwwbbrbwwgbruwugwruggggbw +uguurbwgwbbuuguwrwguubuugwurbgwrrbgbrrguwuwug +uwwuubgrrwgwrbbrgwwwbwugbbggbuuuurgubgwugrbgurbbwug +gwuwgwrrwgrwbwggugrbrggubbuburbbbgugrbuwrurrwbrwgggr +wwgrugrwuguwbruwugguurguwrugubwubrbgwwbrwbrwgbwrgwrruwurbr +gwgburrgwuurwburubuuwwwwgbbwbggwwgwuugrgwrbwrrw +rbgwgbbruuwwugugugrubbuugggwgubrguwwgrwgrrrgwbggbuguwu +rwwrrbrggruuubgruburgwubrrguwbwwgrgbwggruggwg +burgwuwugwbbbgrwgrubguuwugrbrbguubwwwrbbrwbrrugubuwwguuurw +gburugwwrwrrugugbbubrwrburrugrubbrurbrwwgrbbww +wuubbrbubbrbuubuwuwwgbuubugbrrgrugwrgwgwwwwwwwuurb +wuwgrrgwbbgrurbrgrrurbbgwuggggbgwuurwggurrwb +grbbggbgrugwbuubruwrgbwrbbwuugwrrugwrggbrurbwrrurbrwb +uuubbgrbwrurbwbuggbbgrwuguuwubrwgbgrrwurubbrwgggwbggrwb +urgwrgbbuwwrbrrrbbrwgwugwwrgrugwbgbbgrwb +wgbrwggguwwruuwwggwwrwbbbugbruwugbbbuuuwwgurrrbwwbubbwgburwb +buggbbgbgbbwwwurwrwrwbruwgwbbgrruwwgruubgwwwuggur +rbgbwubgbbgrurwwguwubrwubbuuggrugurubwuwgrwgubgugwguugrgw +urbbgurbubwwgbbwburrrbgrbwwubggwugbrrbugwrbgubrb +wbrurrrbgrgbgbwwwrwurrwbuuwrwwgrburwrrbgruggubgrguwgbwur +uuururbwrrwgwbwwrwwgwgruwurrbugwrgburgwrwrbrbw +rrwrurbrgubuguwurwgururugbgrbgubrgrgggurggugurgrbbuwgw +rrwuwrugwwbbubbrbrwrbwbwubgubgwwgrbugwgrugbgb +grwgbggwwwgwrwgruggbbgwrgwubgwrwguwgrguuuuuwgbbubgguugg +rbuurugruurwuwgburwgwgugrwgwwgwwgbrrugguwruw +urubgguwggurwbgrwwbubguwggbbbgrugwgrbgbrwgwrrbrbbrguub +wrbrurgwbubbwbbrwbbrugwgbubrwbgrgwguwuugbgugrgbg +rwuruwurgugggrgrrrugrurgggrrubguurbububugugbwurwuwwug +uubwuwrwwgrbbwgrrgubwgguggbrrwuruuwuubgrwuggbgruggbrr +uurbbgrgbrgbbgrgrbwwugbrrubgubgurrbbrrrbubr +guguggbgggwbbwrwrbwbgggrurburgurgbbwwgruru +wbrrbbuurwruuuwugrgubwuuurbrwurwurbwwbwububwbbbrwb +ubbrwgggwrwbwwwrbgbrrrbrubwrgurgbbgbuuuuugbwgwgrwuwwbuu +bwrbggbgrbbgubbwrrrubgwburgrgrrruurwuuggbguwbwwurrwrwb +gwuguuwbruwuuggrbrrbuwurbggbbwguwwgwwbgrurrwb +rrggbbgurwbbbgurbgbggubgrruuwbrbwgbrguwubbggguwbgruwwrwb +uwugbwwwrbbruubwbrgbuuubbgrubururrbrrgwwbgrwgbrwruwrwb +bwurruruwuguwrbuuggbwbrubbrwuwurbgwwbrgurgwuggr +ruuuwugrrurbwrgrbgurbrwbrbubbwwuuwwuwwuugugbbgrbggwr +uugrgwgwwgrbrubbugbgbrguwbbwwgrubbbgbgbruwugrrwb +brbgbwwwbbuuugrwrugbwurrgggbwwuubwruuburrbrr +wrwrgwwrwrugrwrrurbuuwgurgbrgbrwwbwrggwbrbbuugrbbwugrwb +rugbbggbuggwgwwuruwrwbggwgburuubuwugbggbrbgubrwgr +ubrrwuwguwwrbgwbbbrrgrggrgrgwgbrugubuwwwwuwguuurwb +ruguguwuruubbwwwgwgrrrwrwwuuuruuuwuwgwubwwrwu +brggrwrbrwwwuwwbwrgwbwurbuwwrbrgrrugbwugrbguuwb +gwuugwuuuggrgurbbwggrubbwuurruuwrggrggurgrrwrrgbrb +ugwggbgbbrrwgwrbuggurrbuugbwrurbbuggubwbgwgwuwgwrrrwubuwurwb +wwuugrrggrbrrgwuuugbwbwrurrbuwwwubwrbrggubbubbgrrr +ggwuubgurubrurbwgrwwuggururbrgruwgruugugrbwgrbubrbrb +rwggguwwubburgwwuurrurrrgwgbrgbbbrruguwbwugguuurr +rrbwbrrwbuwwbwrrbbbwwubuwgurrguwugguwrbuwuubbwuwrbggbuu +grgrbggrburrbgwbwbuugugbburbrwrrrguuwbugggugrrrgrwrwb +buubrrggburbggwgwgrbgurwbwwwubbwbgbwwuwbwwrwb +wguuurrggwguurburgugugbrwrgbwrrwbgrugwuugbwgbbuubggrugbub +wbwgruuugggrrubbwrwwubugguguwwguubwurwgwwrbgubwrgbbubrwb +ruwrggugbbbbgurwggruuggwwggrwwrwbbbrwguuuuug +bggwwuwgwbuguwggrgurbwugbbbuurwgwuggubgrwbwwwbwgrrbuug +rrgwugbuwugubuuggbrwwguurwuwugwuuuubgrwrrwrbgrgwbuggwr +grguwrrurgbwbwrgwwwrggrwbwgbuwbbbwbggrbrwbbrwb +uubgbrgrwbbgwrbrwwgbgburbuurbubbguuwbgbuuwburbubggguug +gwbgwrbwwwubuwwrwbbwrrrgwuwbrubwbgggubugbwwgggburrbugrgu +bwgwguugggbrrbuggwggwgbrbugurbwwuuwwwugbbubbrwb +rwgwbgbwwuwrbgbgwbrwuwruuubbrbwwuruwbwrbrwrwrgru +wwrbwwwurggbgggugwuggubbbwgrrwrbwwuugwrbubwgrbgrrr +ubrubggrgguugburwgbbrwurbrburuuwwrrbrrwwbgwbgggwugurugwwrwb +gbggrubrgubgubbwwwwuwrbburrgrwbrgrwbrwguuwwuwrgguwrwb +bbwgbrwggwrbwugbgubugwwuwwggbgubwubgggwwrbgrwrwwgb +uubrbgbbguugrruurbrwbbuuuubbwwuruuuwbbgwbgrbwrrrgb +bbbwugurwrwurgbuuugrrruubrwrgwguwubrurgburbgrrwrr +gggwwgwubwwwrrbubuuuggrgrgburugbgbuurbgrugrwrgwgruu +burugbguwbuwgubugubbburrgrrwuruubbrbrwwbwrburubwubbb +wrwbwrbggggbgbruwwwubuurwbgwgrrgrwubwrrbbggrgbwbwbbbuwbbrwb +uuurggrbbwubuwbwbwrgrbbwgrgugbrruguuugrgrubb +buuugbwbbgwrgruuwrbwbgwbbrgwbrgrwruwwwgwruggrb +rgwrrguwuugbgrbubgbuburgrbuuwwgbbwgurrwwubrgwguw +ruuwwurgwurgbuwurruurbbbbugrubrrgwrgurgubbgbbwgugrwb +urrwrwgugrrbbrgggrgubwbrwwgbgururbwruguwwrgburg +rugrggruuubgguuwwwbgbgbbgugrwgurrruubrgburgrrwb +ubwwrugbguwrrrbwuwggrwrwrububurbgruwbgwrbbbgrrrgggwr +wuggwbgwbbbwugrbbwwubgrbwrgrgrrgwuuwgrwgwwurug +bgwwbbbwrrwugwgwwrruggrbwuwbwwgrwrgrrguwgrurwgurgggrrwb +guwrwubwrwwwgugguuwwurbgugbuwrrbwrguuwgbwbbgbgurrgwbbu +gwugguubwruguubuguguugbuuugrrwrrrurrbwgrbwgwugburuu +brwgwrbbgwurgrugggrrbbwruugrgburrwggwguwuuwrrbw +bwbugwurgbgurwwrugurgbbgbuurugggwugubrwb +bbbuuubggggggwrbrgbbwruwuuwugurbubgwgrrguugbwuggrubrwbwgr +wgrrrurugrbgwbgbbrrgurrgwrurrwwwbgrguuggrgurwww +gubbrbwurgwwbbggurwgbgrwrwbrugrwrburgrrugb +uubuubgguwwbrrwwwwubgwbbwbwwwwugguguwburgbrbbbg +ubgrwugugrruwuurrwguggwuwbrwbwrugruuuwrugwwuwrubuugbrwrrrwb +wrgwguugruurububuurwurrwuggrrubbrrrgugwuugwurgrg +bwubggubrrburbrbwggrurwrbwbgbbgwggubggbubrububrwb +urugwwbubbrrwwwrbrwuwbwurwgrurbwbrurbrwrgrruburwb +rruubgwwwgrwrggubgubwrbbgwgbguruwwgrgburgwrg +rgugrgrbbrgwbguwgguguwrrubgwwgwgwuwubwbwrggbwuuuwrrbwgwu +gwuwbwuwwbwwggbbgrgwugwrgugruuubgwguwwgbbrwb +bbwuguwwwuguuuuurrbbububurbwruuubugbgrbuwgrururwb +bbbugrrrbrgburgwuuruwrbwgwrgwgrugbrgububrbwwgrbrgbuwbgguu +bubwuuwwuwbggrwwubruwbubbwwgwrubuguwbuuwugwrbbugr +uwrgubbrrgguggubuuwrrrwrrurbuubrgbbbwgrwub +wbbguubbbbguwuwbwrgwwubwrurgwurbrrwurrbgrbbburw +rgbwugbubggbrbwgbuuubrwgbrruwggbbggbbuggwg +rgrugbgrwbwgwuwrbggrwuburrbguwguguuugwgubrgruwwbw +uuuruwuurbwubrwgwuuwbugrrwggbwwubbugwgubbrwgwwwugbwwrwb +brgbguwuwggbbwrbggggbrbubbwbrwbbgwuubbbbgwrgwgbbwu +uggrgrubuuuwruuurbuwwugbwwgwwguubuggubwwugrrwbggwrgubrbwrw +wbburbgbbrbbggrgrrurwwgurbubwuurwwgwbwrgbguuuwrubwwubuu +buwbgbrwgbubbrbrgwuwbgbrwburgbbrwgguwwbwgbwbgbww +gurwggwurgwbbubbgbgruggbrbubuwbruwwrwguggrbbbrggwgbrgbgu +wbwwwbbbwgruuuwubbrrgbbggwbrgwwbgurbbwgwgwgrbggwrugrugggbrwb +bbgrwgruggrwwurwwrggbruugbbrgwggrrugrwuuugbrrwb +wwbugbwuguwgbrwrwgrrbuwgwuwgwrbbbubwwgbrguwuw +ugwbgbwrrgbwrrrbrwwguggruwugwwurwrrbgwubbwrggugbruuw +bbbruuwuwwurrwbuwbuguuggurgbgbruruwurgbgbgrrwb +bggwgrggrrugwwbuwgbrbbgwbbuwwuwbrgbwbggwbbgggugwggrwbbur +uuurruuuuugrbuwwgrbwwuuwbruggggbgrbuuggbuuuwgrrb +gbgrgubggbgrgguuwbwbrwbggwurgbwwwbrubwgwrggrbwurggrwrrr +ggbrbrbguwguuugubruggbgwbbuwwrbuuugbuuwgww +wurrbururbgrbrgwggwggrgrgrgbgrrgbbwwgbrgwururwb +uubugrgbrubuggrggrbwbbbruwbrrwugugrurwbgwwwbubgrggr +rgwwbwgbwugugrwrrwubrwbgwuwuruggbguubbwbugururu +wbuwrbggrrwbgbrbwwwbbgwbwrrggubrubbwbubrgwrwburbgb +gbwuruuwuwwwbggurugrwgwubbgbwwwurgwbruwgbgrbwrgurwb +gwururwwugrrubbruwbuwrbgwrbruugbuuugggwbubwubb +wgrgrrgwwruugbrrrbwwrwrrgbguwwgwrbgwuuwbgwuwrugg +ugurwrbgrbubwbbgrwgrwrbgwbwuwubgrbuwwrubrggwuguwbgbu +ugrrburuwwrrwgrugbruwgwbbubrbuwbwwruuurgbuwwgwgbwwbuburwb +wurugurbrbubbbbburuubrbrrbwubguwggwubbrbrbrgurrbwwwuggwg +bwrburggbggbbgbuguwbgwwbbbubugwguwbbgbgwbg +gbwrbgbgbrugbbguruuwgurwwruggggbuburbgwwrwb +rubrgwubrrrrrwbwbrurbwwggrrburrugrrubwbbguwbbgrwwrbburrwbr +wgbuurbrrbgrugwgubuwbgurrwwuwgrbrgrbgwrwwbrururuuwrrrwb +grwuuggwugwgrbggggbwbgwububwrgwgburrugurbugurrrwrwrububrwb +bbggugurwurrgggrrbbrurubbwbuwbbwwbrwgrrrubrgur +gwwwugwuguubuuwgbgruruwguugrbbwgbbwwgrgrwwrrrrrbuwbbwburwb diff --git a/day19/sample1.in b/day19/sample1.in new file mode 100644 index 0000000..29648be --- /dev/null +++ b/day19/sample1.in @@ -0,0 +1,10 @@ +r, wr, b, g, bwu, rb, gb, br + +brwrr +bggr +gbbr +rrbgbr +ubwu +bwurrg +brgr +bbrgwb diff --git a/day19/sol.sh b/day19/sol.sh new file mode 100755 index 0000000..dcd44bd --- /dev/null +++ b/day19/sol.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +file="$1" + +designs=$(sed -n '1s/, /|/gp' <"$file") +echo $designs + +sed -e '1,2d' <"$file" | grep -E "^($designs)*$" | wc -l