From 683cac334ca9d5f9ce8fda4d6fda2a80a2462837 Mon Sep 17 00:00:00 2001 From: Mikael CAPELLE Date: Thu, 19 Dec 2024 08:12:17 +0100 Subject: [PATCH] 2024 day 19. --- src/holt59/aoc/2024/day19.py | 37 +- src/holt59/aoc/inputs/holt59/2024/day19.txt | 402 ++++++++++++++++++++ src/holt59/aoc/inputs/tests/2024/day19.txt | 10 + 3 files changed, 448 insertions(+), 1 deletion(-) diff --git a/src/holt59/aoc/2024/day19.py b/src/holt59/aoc/2024/day19.py index 07e201e..d704966 100644 --- a/src/holt59/aoc/2024/day19.py +++ b/src/holt59/aoc/2024/day19.py @@ -1,7 +1,42 @@ +from functools import cache from typing import Any, Iterator from ..base import BaseSolver +@cache +def is_valid(design: str, towels: tuple[str, ...]) -> bool: + if not design: + return True + + return any( + design.startswith(towel) and is_valid(design[len(towel) :], towels) + for towel in towels + ) + + +@cache +def count_valid(design: str, towels: tuple[str, ...]) -> int: + if not design: + return 1 + + return sum( + design.startswith(towel) and count_valid(design[len(towel) :], towels) + for towel in towels + ) + + class Solver(BaseSolver): - def solve(self, input: str) -> Iterator[Any]: ... + def solve(self, input: str) -> Iterator[Any]: + towels_s, designs_s = input.split("\n\n") + + towels = tuple(s.strip() for s in towels_s.split(",")) + + designs = [ + design + for design in self.progress.wrap(designs_s.splitlines()) + if is_valid(design, towels) + ] + + yield len(designs) + yield sum(count_valid(design, towels) for design in self.progress.wrap(designs)) diff --git a/src/holt59/aoc/inputs/holt59/2024/day19.txt b/src/holt59/aoc/inputs/holt59/2024/day19.txt index e69de29..242f1dd 100644 --- a/src/holt59/aoc/inputs/holt59/2024/day19.txt +++ b/src/holt59/aoc/inputs/holt59/2024/day19.txt @@ -0,0 +1,402 @@ +ggrru, ugu, gwgg, bwrw, bww, brg, brwu, ruugb, grggr, wrgbuug, bbbrbr, rgrrbrbw, gbwg, wuruug, gbgwbg, rgw, buu, ggbgb, rwg, gr, ggurggr, wruuwgrr, wbgg, gggrb, rgwuu, uuwww, bgrw, uuguubw, bbbrwu, ugurb, uwbggg, rurg, ubb, wrr, rbbbbg, gguuug, gbur, wb, bubbu, gbwru, bgg, ugg, bbrrg, wubr, bgwgbwgg, rguurb, bugu, wuww, urugr, bwb, wug, brr, u, rru, wwgbw, gwu, bw, ugrwggr, rgubuw, bbg, bwru, uwgbwu, gbrugg, rgub, rgbbuwwg, wwr, grw, rwggwwrw, bbbu, wr, wbwu, wwrbuu, rbbgwru, gur, buurr, ggbrg, gwg, wrg, urw, uubub, gwrgb, bbw, rrw, ugrurw, rubrw, bgb, bwgbwbw, guw, ur, wgrbu, bgu, rrrrbrw, uww, uuu, wuugbw, wwbugw, rwbr, ruwbr, uwu, wgrb, b, rrwugru, gwb, burw, rurb, rbrrbgu, uwgw, brubr, bwu, rbw, ugbu, gww, wwrb, wbgbrww, brrwgrg, rugug, grgrrb, wuubbgu, brub, rrwwwb, ugr, wbw, ruwgguu, wgw, rrwrg, bwbbrwbg, rggg, gbgrguw, rwgw, rbbgwbr, gub, rgrrg, wbgggu, bbbgww, ugb, rbbgr, wru, rubbuu, bggrbu, gbg, bgrgbb, wwrwugbg, rrgu, wrrubwu, wrbuu, rgug, bbu, wrww, wbb, wgrwu, bbrurru, wgrugwu, uuw, uggwg, rrbuwu, gruw, ubr, urgug, www, wgrwrrw, rruw, rbg, bbwu, brww, rbwbw, grgr, bgr, wgwwu, wur, gubu, rrubgg, wbrurbb, ugub, wrrr, gbbr, wwubu, uwwbuw, wuu, rgb, bbr, rbrbuwg, urwb, gg, grug, br, wwguuwb, wu, ruu, guuwrw, wgb, gbr, wgggug, rw, brggww, wrgrw, guggub, gbbrug, gbbrb, bugrg, bwr, gwwg, wwbbrggw, urwu, rgwr, rwb, rrub, ggb, wbwrrbw, wrub, wwg, ww, ggg, brugwrr, wbur, ubbbrw, uwugrg, buw, grg, rrr, bgwu, rbggg, rgr, wuwub, rg, guuwu, rrwwwrbr, rrg, gurwg, wburrwug, rwr, wbg, grwbr, bgwbwug, bwg, bru, rbwuug, gggg, gurb, bbb, ubwu, gugbr, buru, gbbg, brb, wgr, guwg, gurgrbug, wgwugwwu, uw, wrbbr, wgwugurr, uwww, urr, bgubug, bbgu, bbuugb, rwug, gurbb, bguw, ubbbub, bbwb, gugbgwb, bb, wrrg, ggr, wrbub, uu, wwbw, ub, uggw, ugbggrw, bur, uuuguru, bgwuu, gwr, uurrrw, rb, buwugrr, brwrrrgb, guu, bgur, wggur, wub, gbb, rr, wubw, uuwgww, bwurwur, gubgg, ubwg, grbr, rwgr, wrubw, grgwb, uuguu, rwgwb, bwrrgg, ubu, bwbwggrw, uwg, bgguu, wwu, grwgw, bwrr, uur, rwuww, bwbb, gwrr, gwgrww, rbgw, grub, wugu, grrwuwg, bburbb, wbgb, ubbr, gggu, wbu, rrbugrbu, gbbubrwg, gwwurw, grbb, gbugu, wguwrw, ubggbb, rbgbu, rwub, gb, wbrgr, wubwwb, brwg, bwwbur, gugwg, gru, rbrwurr, wrb, gwubug, ggbguu, bubg, uruub, wuw, gubbr, gu, uwrubg, wggrbug, uub, ggrb, rwu, ug, ugrggw, wgg, rrb, bbug, wrw, uubbbur, uwgb, bwgr, uru, bu, guuuguw, gwwu, uwb, uwwwb, w, rur, wguuw, guru, gwrrwwb, wwrww, rww, bbur, ruuwr, rbb, bugubgrr, ru, rbubwr, grr, bbrbu, gwww, uwwgw, wwwu, uwr, uguw, rbwrr, bguwg, rguw, guwgbbg, rub, rrur, bwwbgw, rrrg, bgggru, ggu, wrrggu, rug, uuburg, rbu, wggrbgb, brguurw, r, guwrr, bwbgrb, urwgbb, rwgur, urg, gbwrw, grb, gwburg, wbr, bwww, brwr, ugw, uwgu, uggwr, brw, wgu, gug, gbu, gwrur, ggbrb, rbubr, rrggurbw, rwrru, uug, urb, grbu, gbgug, bugg, gbw, rgu, rgurrw, gwbw, ggw, bgub, wwgugug, ugubwg, wuggr, ruw, rbr, bbwuwwgb, wg, ubw, rwwg, wggbr, urubb, wwb, bubr + +ggrbbwbbwbuguwbuguwbbuwrbbbrwgurgwggbbwbguurb +gruurruwgbwwrbbggwuwrwugwrguuwwrurugbbgubrurubrgwubg +wguwwgbbggbbrbwurguububrwgbubwbwwuwgrgbuwgubg +gbgrwggwbgwuwbgwgwgubwguwwwuwbwugbwgwrgrubg +uubwgrwrwrruwrwggggwwrbgbbwgwwbwguwbrrwrgugbrbwrurggb +rgruubburgubugugbwuguwururrbbgwuurwwbugburgrbbgbbgugwgbgg +urggwuuwgubugurguwwrrbwuggbwbruuwbwugwwrwrguubbbbw +bgrwuggburgggbubbgrwwrbuuwgwrrwuuurbugwgurubrwwrrugru +rrbbrwgurwgrrgburbwurgbbuwrgrwwgrrgwrbrbrubbrwrg +uururbwwwurbruwwwbubgbrugubrwubgwuuubggburbbu +wrwrrgbrgwgububrgwggbguurgugwbuwgwwbggurbrw +uugbgwuwbgwggrbwrwruwgrrwugbguwguuuuwurugwwbbruwuubg +gwgrrwrguwgwbwgbuwuurgugugguwbrrrbguwrwubgwrgubggbburbu +bbugbburwuggwrugrbgbbubbrrurbwbwburwrgubgwurgubg +wuwubwguwuwwbbwgwugwugurgrbugurwbuubbuurrrrwwbgrgwgwgwgubg +wurgwbwrgguwbbuuurrgrrgrgurgbrubbrgrgwbrrbgrurguurw +brrburwwuwugbwrrrwruuwgrrrgruwrwgrbbgwwrruwwwbrbguuuww +wgurrugrwbbrgubwrgbuwuubrggubbrwwwbwrggwggbrbg +gurgrrwgruwbruwrbbbrugrgrrwrbbubgrbgbbgrwurwuguubgw +rwrrruwrwwruugbgbbururbubgrrugguggbwgwgwguwwurb +wuguguruwrurbwbwggrwuuwwrbwrbguuwwwruuwrguubgwbg +wggbrgubrwrwgwubbgbuwgwggwgubrwurrrrrbggubg +urgbbgggurgrbugbbubwbugrburgrurbgwbwuuuugbbuuuuub +gwbuubrgwrwrguwbwubbruurgrrwwuwrrrrrwbbwuguugguwbrurrbbugw +rrwuubbwruwuwbbbrrgbguwbguwgbruruubggbrbrwbwgbrbrbggu +gbrruuwuwruwgwuubrwwwuugubwubwuwbwwrrgbrgwrr +rwwrrbbgurgwuwgugwrgbgbgurwruwwwruugrbggwubwr +uwbrrugrbgwwgwrguwgrbgwbrbbruugggwgggwwbwrwgr +wguubgwuuwbrbgrgggrgbbguugrwgwgbrgugbrugbbuuurrruruuggrbr +uwggbgrugruguggrrgwbwbguwwgugbgrbuuwugrubbgbuubg +wbuwggugwruuurbwwrrrrbbwruugurwurrbggwgubg +buwrbburrubggwurgburuwrurrgwgbuugrruugbbbgrgurw +ubugwbrbwwrugrbwwrgwugubrrbbrwbbwbubugbububwwwubrrubwur +gwgwwuwurgruubbwgrguuggubrrubgrwwwbwbwbbrrburbbbu +rrbrwrwwrwrwbwbrbrgwwbrwwwrgwubwrrgbuugrugurrbug +wurgrrbuurrbwwgwbguuuwgruwuubuwwgrrrwubgrbgw +bbrwbrbbwgubbbwgubbruwrrbrbrrrgwbbruggbgrr +buurbwrurgwrbugruuwrbbubbbubgbuwurugrbwrubuwbwwgb +uwbwwgugruugbururbgwgrbbwruwrbruggbrrgbburggbwg +grurbwwuwruwwbrrguwbwwrgrruuguubrrubrrrwruwwrrggbuugwu +ubgrrwbwrrbbgrrgwuugrggbwgrrwrrrwbbwubrrrugugwubg +urwbugwwwbrbbggwgwggwuwwggbuurrbuguubbrgubrwgrwubbrgubr +wbbrgrugrgwuuwbubgwrgwrwuubgwwubuguugwgbgwuubg +gwwrwbruwwgwbgwbgrggwwububurbbgggruurwwbgbbrugubbwuwb +grggruggrgggbrubguwggruwbbbgrgruurrrgwguwuubrwbrrurgrubg +wugbrrurrwbgurwgggwwgrurrbwubbuwwwburrwuggubgwwggbwggubgu +bbuwrruwgrwuuwgrwrwgggbwrgrrbugubgururrwuubg +bgwgbwgguwbugrrbwwugwuwgwbuwbwuwrgwbuwubggurbruwruuubr +bwwrrggbuwwgrrgugruuurgrgrubrbwuuwbwgrubg +brbrwrurruwurrwwbuwbggbuwwrwbwwruuwguubbuubgrbbuwwgbrrr +rbwrwwrrurrrgrbuubburbrrruuurruurwwgbbguwrwgggu +wuurbgwrggbuggbgwbubgbubgrrwbrbwgwwrrbgububrbr +rgbugbrgrgwurbguuwburggwubggwrubwwggbbrrbbugbbrggrgwbbuugr +brbubwwubwbwwwrrubwggwgwwgwrbwgwwurwbugrrguurbb +grugwurwrwubbbbgubgbwrugrwwbgwburwwbrgwubu +gurrgwbbbubbggrwrrrwbburwruurgrguwggrbwbuuwguugubrwbwb +rrbgrrubuurwubrrbrrwguugrwrgrrguwggrgbrbgubububbrb +wgrwgwgrgbguwgbrwwgrwbuuubwrgbwguwbbbbuguugrwwwburrbruuuubg +uwgrrgrrbrwbrrbubggggubggbbgbbwbrugwrwrbrrwwgbwr +uburgubgbbbwgwubggwuugwbbgruwubbugbbuurwruggrggwrugrbwubg +rbguwurwwrbggrrgruuwubwgbbrgwwrgbrugguguuwwbbrggwbwurbgubg +wrurwburbugrrubggubgbwwrbwbwggrwrrrwwuguwgguwrbubbubwrb +ugrburuubbrbwgrbugrggwgbwuurgrwuwbuwrrbgubg +wgubrbggbwubgruwgrgrwrrgrugubugrwgrurguwrgrububbbg +bwgbbgwgurwgwugrbbgburgwbburrurubwbbruwgwbububgrgbrwgbuwubg +wuwbuwrbuuggwggbbugbwbbuurgbgrrubbbrgggwrbwugguwubg +wwbgbgugbgggugwrrwwguwbwubggbwgurgwurwrgwubg +bwwubrrwurbgwubbuguuubrgrwrrwuwrugguuwwurubgw +rrbbuwwrwbbruwwububbrbrwburrrrbubugwugbbgrwrw +grrrbwgwugurrwuwwrrbwggubwuugbuwwwgurwgbuurubggbgw +rwgbbgbrgubgugubwwbbruwggbwwwgbuwrrguuwwbubbrwgbgrwg +urgrwrgbrgbggrurubwwrwrwgrbgubbruurbugubww +gbburgbuggrwwgrgguugwbugwwrgurbwbugurubwbrrug +bbruuuruurrgggrwburgbrurwurgrrrbrgwbuwrwrugurwwwbb +wggguggbwguwrrrbwrgugrgwuwrubburbgbruubwuggbubuurgww +ggrubgrggwgburgwurubuubugrgrbrwwwgbbwrbuwwwruwwwwrugwb +rrrbugggrwuubwrbbgbgrwggbggwwwrwbrugruurwgrruuuubg +grurwggwgrubrbbbubgwrbrrwgwugurubgrwwwguwwbrbubwbuuuwgwwbw +uwrrguggwbrgbgrwbgguubgrrbuwurrwbubrggrwbgu +wbwgrbgwgwrwgguwrrugbwburrwugbuwwugwwurrguuuwbbwburubgrbgw +bbbrbrgwbwwgugggwwbggruwwbwurgwggbbbrurrwwbugrrgubg +gbuuguugwrburruuwbbwbbwubrwbrgwwwurrbgwbbugwwbuwuwgruubg +bwbgbwubugwgrwbubbugbwuwbubrrrwwggwbrggubwrbrbubgggw +bbbggrurgggubbbbbburugrwggwwrwggbwuwbbgbggbrbuurugbwugbg +ubgbwbguuwbrbruggwguburwwgbrwuwguwguwurbrbrrurww +bruwrrurrwwwrbrubgrrguwwrrgggbbwrwwgbggrubg +bbwugggwrwgurbrbgrwrwuurwwwruuugbgrrbuwbwbwgbgrwwburuubugg +rgbgugwwwrubgggwwbuwrugwbbwwbwuwwbbgugbwburgrr +rwrgrwbggwugguggrgurbugwbuggrrrrguwbgwubg +urwruuwgrrwggwgrwuwgrggwbuwwbrbwuwwwrubg +urwrbrrbrubbruwbguuwwggubuguwwggwwrugbuwwrbbwwgrrrbggb +uurguwwgbrbbuwrrbrrgrbggrrurbwbrwugrwugruurbgbbu +ggguuubrgwgbwuburubruuggrwwururubgwwbbubbrwbgwbubbwrg +grwbrgwbbgbwwwruubgbwbbbrbgwurrrururrgurubugbrrrugwwbuwbw +rgrubwgbwwgrbwburgwuubwbwwwbgrbbbwbbwbrwgbbrggrwubg +uuggwggrgwugrgruurgbwrugwbrrbbbgwrbbgbrubg +wurrguubwrbwuubgguuwrgrrugbgrrrwrbrwrrrgbuwwrbwrbgrgrgbwbu +gubgbwubgbbbubwgrbubbgwrrguburururbgbbruuuruu +ubwgbrwbwbgguwwruububgrrggrurruuuwwuwubuubgubwwgrubwwurggubg +grwwwubuwurruububbwugubgggwrbgrguwwwugruruubgwbbrwuruubg +ugrgbwwgbrwrwugwubbwuubburrrgrbbgruubgwug +bgrgggwurrbggwubbrgrwbgwwwwwwbgwwbwrwbbrugwrububwgubg +uugwwurrwggwrrbgwbrrgrrurugbgurggurubgbwwubbwrru +bwgggbrubwguurrgwrggggbgrwwwuggbrwbgrgbgbrrugbwwwgbbrbwu +bwgubrubrgbuwgbbuwgbwuurguwuuwwbruwuwbrrbuubg +gbuwugubrbbburrwbrwuubrwwrwburwbrwguggugbrbwburww +brguguururwgwwwbrwuwbgrrrgwwrguwwbuwrwguwgwwgwugwwugubg +brubrwbwwrgwgrgguwwgrrbggbrwgbbwugbrgwggbbgbgrbwgr +wrwgguwbrggwbgururwbrurggurwwrbuurwrrrrwburugggugbwrgubg +grwwwggubgrrrwuwggbwrwgbrrbugrrbuguggwuruwugr +wrwwwwrwubwuugurrbgugrwrbgrurgbgbubgbguuwubbwubg +rgguruwrugrrrbwwuwwrwrrrgguwbgbggwwbuguguguwwgggbr +wwwgwbbgbgbgbuwugwgrrgwbrwguguwgrggbwwbwwggbuuububgwbggugg +ubwruwgbbwwuuwuurburgwgugwuggrbbgrgwguggwrgrggru +rwrwguruubbgubrgubuwgrbwgbgbruwgurgwbbbgbrw +wuggwrbrwwurwuuuruwwrwubwrgwrwwbrugruwbgwbgguuggbubwrrwguu +ubwwuuwbggrwgbuwburuwrubgrgrbubgwrubwbwburubbbgu +bggrbbuuuubrwwrrbgrggrgurugbuwbbbgbwubrrgu +bgrwuggwwbbgubbwrggubrwwwrwwwrwgbuwbbgggwuurbugrg +ggbgubrggbwgrgwbbbbbgugurguwggbrbbgrwuguwwruwbwwruuguww +gbwbrrgwwggguwgguubwubwgrrrwrwbrgbrwbrbwbwuwrr +uwbbwrrugbgrrbwwrwgwbggbwwrwggbruwururbwgrggrrggggwbbu +uubbwuwbgbwgbugbugwrgurrgubwuguwrrbwbbbrgg +bbwrwrwurubrgrbugbgwrgruubuurwurbggbbrguubg +bbgrgbgwbbugwggwbrwubwwugwbwgrbubbubbbgwrururwwgubuuwg +rwbwgwrbgbugrbwgburburbuuggwuguggrgrwwurggwuubgw +uuuurubugrrbgwwrbuwwwbwuuwrgwrgbbwubggbwggwrgrbb +ruuwugbgbrrgrwgwwwgwrbuggbgwubwrrbbrwrrwwgwbgrwrwbg +wbbbwubwgrgwrwgwgwubwrwbwrwuuwbrwggwwrwrrugubgubg +ubwbubugggggrrbggrwwrguubgrwrrbgwuubgbbuwwubuuwubgbuguubg +rrwugrgurguguwggbwurwguuruwgwwrbwugbwrbbggbrrwgww +ruguwurwgwbrwwgburubwuugwbgbgwwrurggbrubbrubwrugugugrwrg +ggburgrubrbbbwgwuuwuugwuubrbuuwgrbwbrurbwuruu +grbbbbrwuurguruurwwgbwrbburrbwugggwrwuruurgbrwwrwgb +ruurgwgggwgbwrgrwbruuurgrbwrbgwuwbbrbggrbrrbgubbw +gurgbwbggrwbrwbbgbwuwwbugrurrbuburbwbgbgrugr +urrbgwugbuwbuwbwgrbrbugrbruwbwbwwwbugrrgrgbubbuurrrugwbwuubg +ruuwgbgbbgrgwrgurgbbggwwuwrrrugwwbgruwugbwrgrruurbrbguu +grbuurbrubrgggbbubrwgbwwgbgrbwubrurbgbuwgubgbwuguwrubgubgw +bwbbrwwruurgugggbuwugwbuuwwrruurguwbuurwgbguurbgbrwbgurgubg +rwggrwbruwgwrbuuwrruguwbbrrwwwrrgruurbwuwggrwbwgurwuubg +gguruuguurugwuwuwuwurwwbgbgbuwrrwwgwugrbuubbbwrrggrubbw +gggrbwgbggurgwrwrwgrurrrgguuwggbwwbrbbbrgwbrubrg +ububggbgrbwbbrwbggwugbwrbrgwbrgrbwugwurgwrubg +ubgugruruururwrwgguggbbgruwwruwuururbgwurwbrubgwgrw +gbgrruwurrbbwbgwbuwggggbwuwwuubrbwurrbrwrrrubg +rgwgrubrwbrwgggruwwbrwrubwwwrwbggwuugrruuwugbrg +ubgwrrgbrgbbrgwbbwubururwbwuwwwugwwwrgbbrbrwgrgrbbur +wbgbwgubbrbuwgrubbbgrwgwrgguburrgbwgbbwrgbgbwwwrwbubr +wurubbubrgwwgwrbwrurrbwgbuugugwbgwbgubbubwuwbwbugbgrwurrg +wrgggrguwgrwbbrgbrbbwwuwggrggburugwwgwuguburbwugrrgbburw +rrrruwugurugwrggbgggwrgwbuwuguwbubbwgrbwgr +rbwbbwbbwgbwggggwrbruwbugrgugubbgwrrrugubg +rbrrbrgurwbgurwbgrwuwgrwwgbbrgurgggrwbuguw +gbbgubwbguururbgrwuwrwbbbgwuurbbuwgwwruwwgubgwwbg +buwrgbgggrruugugbwuruwgwgwwurwugbbbbbrwuwwwbbugubrgrgu +gwbwrubugbrrwurwgrwwwwbwbbrgwubbguurwguuwrrb +rwugguuubbbrrgurrbbwrrwuurrggrruwururrrwwgububwgurubg +bbgbbrbgrwrgwuuwrrwubbuwuwrwuwrburggwwburwbugubgrr +uurwbwubwbgrruwwbbwgwgrrbrubrrbubwrwgubg +rrrgwguwwrwugbggrbururbgrrgugrbgbwugbgrwubg +gbuuwbrubgrrwrgwbwbgbrgbuuubrugwggwurrggbbwuwwgbwwbbuugubg +bbwbgwbwrrwgguwbrwgrgbbubwubwgwgrwguwurrrwburbgugbburuwubg +ggbuubrwrwurwgwbwburwwwgwwwrgguwgurrggbwurrgwgw +grrwrubwgbbrwburgrguurgrurwbwbrbuugrwuwrbwurubgwgu +brwwwrruggbbuwrbbgrugrbwgbwwwrbgbwgburrwrurgubg +grbwugwrugrwrwrgrrbruguwugggbrgbrwbwruwgrgguugbgwbgrur +urwgwwrgurrubugwwuwrbrrrbwwrrbwuuwuuwuwururuguruwbwurgr +urgrwuwuwbbrbwrbuurbbwbbwggbruwruwburgrwgwuwrruuubg +ruuwwrwwwgrrwwgwubwbuwgwubbggrgurruwgwrwugb +urbbgggrrrrrrrrwwbrrbgggurgwwugburwbuuuwwwrurwrrbubwrrwrw +rwbgrbbwubgbuwrrgbbguwbbrbrwbgrbuwwwwugbugwrwurwgwubg +ruwbuggwgbuuburwburgwgurrwrggrrgurrwburgbwbgr +bwwgwggrgrbbggbgrrwbggugwbgrgbbrbwbbrgrbbuubg +gggbbwbwgbbuubwrbggburrbgwwruuguruuguubrwrwwuubgw +bwwwbuwrwrwugubrwbgwrwrguubwrugurrgggubg +grwbuwwburbwbwurguuggrruuuurwwurggbgrbuwwrgr +wubbwuggrgwbrwgbwrgwwwwuubuguuwbgruuwgrwgbuuwrwwurubgwwgw +bbrwbwuwgwwbwwrrruwwbwwuwrguuuuuwrwurbbbbuuugurgugw +wggubgbuubbuurburruwurbgwbwubbgrgwgrwwbbburggbu +buurrrwbgguuurbbbgwrgggggwuwruwwbgguggbwbrrrgrggwg +gwbwrgbrburbguwbgrwuwgburgbrrubrubugbrugubg +rwgrgwwubguggrwubggbrrurwbburbuwrrbuwbgrbgrruwgrrwwubg +wbwwgwrgguguwrrgggbwwbrrgbububwwwugururrrbr +rbgurbrbgwrbgrwuwruguubgwuwbgwguwuwrbruwbbuwubbu +bgrgbwgbrwuruuugrrbugrburburgrbgubbrwbubwgubg +ggruruwrrwwwrbrgbwgwbuubgugguwgbuuwggrwgbgburbgwbr +wrgrrgrwgwbbbrgugguwbwuubbwbruuwwrbgggugwwgbbruugr +ggwwbbwugrgbgwbbbuwwwwuggrgguuwggrrbbwbugwgug +wrugrwwbwgbwruwuwwubugubggbuuwgbwgrurbgbuwguurrggrrbwwwguubg +grwurrbbuuuwrubbrwrubrbbubgugbugbwrgwggurwubg +gbggwurwgguwwurrubrgwbrbbwgbbrugburgbgrwrwguuw +rrwbwuuuugwrbwuwgbbbwbwwwrgrwrurbgrrgwrbwugbrrbrwubgr +uuwwbgguugrbrwgbwrrbbrwrgbubgwrggwwuurrgbwrbgwuugwruuwwbgr +wgrurgbugwwrrwrrrgbbggrwuruuwbrrgrrgubrrubg +uuwrruubrbbgururrrbbrwruubbwwgbwrgwrbuubgw +urwrggbbgbgrwgwugurrrgbuuwbbwrgrwburrrbugwggbuwgbw +urrggbwggggwrgrbgbrbbgrgbgubrggbgbrbwggwuurubg +wwbrbwbrrgwuuugrgwbgrwwgwuwuuwggwbbwggugwrbggwgrugrbubgw +bggggurbgugruwuggwuruububwugrbbubgrwurbbrubgw +bbwwgguwwrggwrwbwbbuwwugugrrggurbwwrgggbwuwbuburubg +rwgbgrubrrbuwwbbbbbggwruwubgbgguwuwwwgwggbubrr +rurwgwbwuugwruguwbwuururgurguggbugwwuguuwrwu +bwrbwruwubbgwguwgrwuubuwgwugwwgrbrrubgwbgbrbwugwbuwwwb +rwgbgrugggbgubugwbbbwggbguugwggrbbbrubwbubgrbb +rgwwrbrbrwrgrbgbwwuwwgwrbuwrgbrrurugwburrggrwuruub +grwbbbubbuububbrrwubgugrgrwruuwrwubrruggbuguubg +bbrrbrbrwbrgwgwuwguuuubbruwwbuuwuuwgwugbgur +uuguwbururbggrgrugbrubgggrrwwuugwgbrubwgbgwwgurr +rgwrgbbwbwwruggguwbrugwbrrwwbwrgwbwrgrrbuuuggbuubgw +wbbbguwbuuugrurggwwbgbuugwwrguggurrrbbbrbgbrb +wrbuuuwrbgwuugubguggrggbgbuguurbrrbrgbrurbrbbuugrw +bgubwwgrbwwwwwbrrrwgbwwugbuwgwruugrgbbuwwgrr +urrggurbwwrurbwbwrbwwwwuurugguwrggwwrrwgbwbrrruru +rwbgwguwurrurbwuwrubbwwbubwwwwbrggugubgw +burgrurbrugburgrbgruwggruuuwgrgwuwrgwurrrrurbwrwwwgbuwubbb +rruwuwgrubrbubugrwbwuuugwuwubbgwrbgwwgubrurwbgwbwwgwgwbwuu +wgrbggrrwbbgurwurwrwrggbwwrwugwrwuugwgwubrubgwbguuwbwwgbu +guuwrrggbrrugbrguggrbubrggbwururwbrgrwrbwb +gwgggggbgrgbbbbuurugwrruuuwrbwrggguwruggwgbbugu +rguwrwrrubbruwruubwggbuwwgbgggguwugwwubwrgwwrubrg +brggwbbbubbrrrwrbwrwbgubbugbbgwgwbrwbggurbbwuubbgrggrbbr +wuuuurbbuwgubwbwrrwbbgbuugrgwgwuburubuuwbw +ubgwrruruwbwgurwrrrrrbrrbrwuubwrwwbrwwrgww +grgbguubrugrgbgggwgrwgrguwbubbwbugrburrugrwbwbgurubgw +rgguwgruburwgbguggbwgrgggrubgwgrguubwubgw +uurubgbbuubbguwrgrwwgguwgbrrwguggggwurbwubg +uguguruuuugbgwgwbuwgbrbrwrwbubbuubugrwwbbgubg +guuwwruugbggwubrrgrbuugbwuwggwrggwgwuurwbgbwbuwbguurbrbggu +bbubwrgbggrwbbwguurrrwrugbugbruwruwwbugrwbugbbgrugwrwr +guwuuwurrububbgrwugruuuguruwbrbubgrrubgggbu +wrburuguguburrbuuwbgurbubwruubbuurgubrugrbgubub +wurbrruurgrrruggbbrbruuugbbgggurbgbgwbwbrbugubg +rwrwwrurrwgwgbrubrbwwrrgwurruwgwguuguubg +uuwwwgbgwuuruwrubrbgrbruggrggbwruurgguguwgbrrbrbwwuubg +uggugggbwrgugwrgwubwrwgrubggburgggwrbgbgbugruwugg +uggbugwwbggrbbuggubrggwrwwurbbuwugwruuubgggbww +rrrugrwrrrgwgbuguwgwugrbuguubwgrwgwbrgbbwguwuuubgwb +uwwrubgrrbbugwgwbgbrgurgrbwbgrwbwrgwruuubgwrrbuu +gwrrrwrrggwrrwgbwruwubuwwbgubgwgbwgggwuwugrgwruurwgwuubg +grrwrbugrbubuwruububbrgbuwrubrgbugrruurgwgrrgubg +gurbbbruuuuwwbbwgrgrwrrwuwubbbgburubwruwuuugwrgbgg +urggrgbwbwbgrgrrbrbwguuwbuwwbggrgbbbgggwuubwbw +ubugrubuugugwwrgwrrrbwwgbrrbruuggguugrugwrurrgrbbguwuwgrg +bubrgbbrwguuwbbgwbbbwbrgrbbbwuwrbubgrwwgbwbrubg +guwwurwgbwgbrurwuuruwbbbguuurbwuwubwbrrgrbwgwugrubrwrwbuu +rrgruubrurwurwguuwbgubruwugbuwwurrbwwuwrwwrrugrubguwubgw +ugurrrwbguggbgwggwurgggrgggrgbwuwgrgwrbugr +uwbguwugrgbgwwbugbbugubgrrgwggrgwguwgugggbu +rgbgwuwuwrrwbggrbuuwrwbrwurrrrrrwrgrgrburbu +gbwurbbbuuwugbwwgubruugwubbbbwrbwrwrrwggwgwgwbuubg +wbuggbrugrrbugbbwrbwgbbgbbgrgwwurburuurbuuuubrwgruwgrrbrubg +wrwggwurggbuwrwbgruugguwbguuurgwuwwwbbruuu +wwrurwrrwbrbwwbrgguugbugbuwwwwwwrurgbrgguguuuubg +wwubbbrubgrbrrggburgwwgugbggggburwbguguwwburbwbbgwubbur +gbubruwrwuwubbrgwuburwrgubbgbuwugruubbwrgrwubg +ugrubrugwbgbbgurrbwuwurgwggrwuwbbbuuuwugbbuugrggbgb +gwggwgwgrwubgubrbrrubrugwrbgrgbgwbuwrburrrurbgrrubgw +wgrrggwwubgurwrrruuwbwrrgwwgwruugburbguuubruwuwbrggbrbb +bbrwguwgwgwbgurbruruubrbbgrbrgburguwuwggwwurrrgu +wrrbgrgguwugwwbgurgwgbuwbwguwbwrruwwrbugwrruuwbbwurbwrru +uwuwurrwrbruwggrbbrrbwubugrbgrrurgrggwrwgrubbb +ubugrbbubgwgggrurbburwbguuugwguwgwguwurrgwuwwbugrrburb +ggrwwgrurwbrrbbbbgrbwggbwrbgurbbuurwwbbwggugww +wbuurbbbrbgruuggburrguubgrrgurbubgwuuurubrr +wgrwbwwwbrurgurrgbruggwwugwubgubububbbuuuuuubrgbwuwuurbw +bbgbggrbbburgubbruuwgggwrubuuwurgrubrwgbrggubg +rbgrbwubwurwbwwurbrruuurbrguwwwrrbugrbubrwugrwb +wrugurgwuwurrbrwugruguggwbwwwuwwwrrrwwubg +gbwuggbbwbbuububruburrrwggwbwbwgrbgwgwguwrubuururbwuubgwub +gbubwwwrruwwubruugrbgbgwrwrrwruwwuggbrburbguggubuugubg +wgbwgwrurwwurwbrububrwbrrgguwwwbwrrbruugrrru +ubrrbrugbwuwubgbbguwrwugggbrgrruuwwuwubbgrwurubg +uruuuuuuwggrbgggugugbwuuurwgruwgwugwrbgubbrrgwubg +brruurbgbburbrugwuuuwbwrurbubbbubgrgrwwurgbugwgwgrugwuuwbb +gurgwuubwrrrwbuguwuwgrbrrubrwgurrrugurbrrrrrbrwwrbugrg +wbwubwwuugrrwrbggurrgbbuwwgrwuguggbubgrrgbrbrbbgwbrubg +rrwubrwrrbgrruwrbbgrwrwuugggwgubgwuwbgwgbrwwgbgbgbgwbgrr +bbwggbbwuwwgbwuwwuuguburgwbrgbrwwruurwbuwrrbuwgbrw +rbgrbuwbuwbbrgrrurrbuwbrwrrrbruggguuuubbrbguru +ugwwubwgwgwbbbbguwbbuggbuwuburuuwwwwbwwrggwgrruwwwwbbubu +brrrrwugbuwwruwbwgbrgwwgwbbbrwrrrgbgwbbbgbubgwrurgrubg +bwrwrrwwbwguwburrrrgwbbrgubrubbbwuwrbrwuwburrugwwrwwrbbruu +gurrwuugurbuubrgbwubbgwubbbbuwruugrrbgurbggrrrguu +gwrwuuruggwbgurwwgwrwuuwwbgggbrwbugbrrgwbgrwrruuuurwrg +grggwgwgbrrbbwbrubgbrggubbbbgbrgbwwbwbrgubggbgbubgw +ugbgubrbrbrggwguwwwrgbgruggurgwgrrugbbbuuubg +gubwugguwrbuggwburrrwguwubbgrubbuwruubrgrgrugrwrrbrbbugwu +rwgwwgubggurrbwrwrguwrrbrggrggwwgwwwruuwgburrrrbuugbg +wwrwurwggggrrrbbbbruurgguwwrrurugurgubrbwgubgwgrbwbguubg +rwguurwrrwwrrwbrbrugwbgrbggbbbuwbrrrgbuggwwwuubg +wubwbgggubbbgguwurwggwbwuwbwwubwguurbwrruwwrubg +bbuugrggbbwubgurwbwrwwuwbwbggurwguggwbwubg +bgrugwuwbgwwrrwwuwubrwurwbuurwwgbrgwwggrwgwuwububwbbuubg +bubrggwuugrgrwgbruugbgrwbgbbbwbwwurrrgwgwwbuggguu +ubrbwbururbrgurgugrgurbwbbwwgrugrbubrugbbbbburbrurgrwgwgu +wuwubuwbbugbgrrwrgbgbrbbugguwbbwwwgwugwwurwwuugbwgg +bubwbgggwugrwgrrrrrrrrugguwwrrbwrrggbruwuurwguuwwgggwwwrgw +wubbbuuwwbbwubgbrgurbggggurwrrbgbrwwuggwubgw +wbubuwuuwwbuwwbwrbrggwwbbuwggbwuuwwrgrbwurguwgbrrwwubgw +gwrwggrubwguubwuggugwrrwgbrwrrrwbubgwuwbbubww +gguwuugugbuubrwbrrrbrrrubwburrgwgwgwbgurbgbrrwbrgr +bbwbbgbbwwuwbrugbwruggbugwbwgurgwgggbrwgug +ubruuuuwrggbrggbugbbwwguwguwuggbbwguuburugrugbrgruuwbbbwubg +wuggrwgwbrgwwbbwbgwrbrwgurwwgbbwrwbgubwrugggbrgrbbrbgrrgubg +rbwrubrgwrgrwugurwbguuugbrbbbwubbwbbguwbrrbbbwrrwg +brubruurbwguwrrwuwrugbuwwwgbrrgubwwgrggwgbru +rrbggwrbbwbbrwrrgrgbgubggbrwwrrbburwwbrwuwbrbbwbrgw +wrggruwrwwwwwwugbrgwgggurubbrbbgguggrwbgugugrrruwu +gggwurggwwgurugububrbbrurgwwrgrwwbwubwubrwgwrubg +uwbbwgrrrbrwbrubuuwwguwguwgubbgruruguwbwubg +bwrrgburgwguuurwggwrwgrubbbuwruwbrgwbuuwubug +ugurrwbgbuwgbuugrbwgugwguwwbrugwbbuwurugugbuuugbu +bgrbwbbuwbrrgggwugwgwrbbuwbugubgrruurubg +ggbrrgubbgurwwrgrgbbuggwrgwruguggbbrrrrbbrbwurwr +ggbgbubuubbgwgrrrbwwgbugrgrwbubburgbuuubgw +ruugggwrbbgbbuuburrgwbwwgbwgurbrbbggbgubgw +guwrbugwuubgubggwgwbruugrwbbwgwrwurrbggrrgwub +bubwgbrguugrwwgbwrwbuuurwrwrgbbuguwwbgbwubg +brubuuwgbgwgrggruruwrrubwbuuwwuubbrrrwbuurwuruuur +grgurgggwggruwuwrgrbgguggrwrbgbugwbuuubg +bwuuwgbrbwgwurrrwbrwwwbuwugbrrggbbgbuwgrubrugubg +wbbbwuwububuuuwbwgwrrbuurbwbrbgwuuwuggwubrguuwggguwuubwggr +uurgwgbgwrwwbguubuurwwrwurbuubwbwgwuurwwwwubgwrugrgru +rgwgbbbgguuwuugugwbrurbwbbbubwurwubggwuurggrugwbgb +gwgbwuwwgwuugruugrruwgbwwgwugbuwbrrbbgwwuwgwbgwugwbbrrguw +grrbbuuggrugbgbbbgbrgubuwrrrwrbwwwguwwgbgwgggwug +wwwrwgbgruubuwbrwuuuwggubwbrgrrguuuwbuwugbrgrbubrbrubg +ruwbrwugbbrggwguurgbrugrgbruuuwugugwurruuwbrbwggubg +uuuwuguwuwrubgbwbgurguubwwrbwrrgbrgrrbbgrrrgwgrur +uwubuubwrggbwwrugrbwrwwruuwbrrbuubbgrruwbg +buuwwwggwbuwwwwgwbwbguwgrwrrgbwuubwgurrguubwwwub +gguurgrurbrgwwrwgugbgurbwguugrgwrrwbruugrrubggw +rbuuwbwgwrrubbrbgrrrugggrrubgbbrbwgbuuurrubg +rbburbbwbwurrrbbggwwgwbgwggbrbubwgrugurbbbrgubwwuwwu +guwrbgbwwuwbbuwrwgurbgwrbwbwburwwggwruruburguw +ugubbggbwbubbgrwuubruwggbbwrgwgbguubbwgwwggrrburuurwrgguuubg +wggburwgrgrwuugrggburubrbwbbbwggrwbwuwguuwbr +burrbuwuwwwbrrwguwggubbrbrgrrguwuwwuuuwwbgguuuwubg +wrbbwubrrugrrbruruuubuuwbruruwburrwguwggbwwuurrgwugbruubgw +gggwbubwwrwbugwuwwuuubgwguwbubgwrbuuwbwubbbrbrugbgbur +wrgbruuguubgwbuwrrbubwwggrrrrbugugggbrrurrrgggbbgrguwrgwb +gugbrwurgruwgrrwgbruuuuwburbgwwwwwubgbrgwwrrrbgubg +wgwurwwbuwbggwgugrbwuruwuwuururbrrgwrbugugrrugubg +wbgwgrwwuubrurwwwuwwuuwrwuwuburwuwwuubgggwuuuwubgubg +rwgwguwuubwuwgwggrwgwrrbbggrwruuggrbubrrgbuugwuruubgrgr +rbububguururbwrurbrubbubuuubguwbrbuugrrbgwwgww +grubwubrgwurubbwbgwgubguguuwbgruwubwwrbuurwgurgbr +uubwgwwuubgggbgbruwuguuwbwurguuguwbgguuwwrb +bwwgbubrwwbugbrrwguwugruwwgbwbururbrbgrubg +ugugggbggbgrwwugrggbwbuwggguugububuwbubbubuwgubgw +ugrubgbbuuuwgbuurbgwbwubguggrurgwrwgbrrgrbruwrgw +rrggurwrrwugguuwrwuruuguggrbwwbrrgwwbrgubgw +rbrbgburgbuuruuugbrggbwgrubrugrbwruuwwwwrgrwwr +rrggbrgrwrbgrbrrwrgwrwwwwuubrgwwggubbwgugrwrurbgrrruwrb +rrbrwrrrruurgbwbggrrwwgubrwgggwwwugrwwubgwruguwugwbbbug +rgbgrwgbbbguggwgwbwugbbbwgbgbrgguurgbbbugrubuwrrgwubw +bggwwrbuurgwwwbrbggggbgbbgwwgwwrbwbbrwbgbbrrbgrgwwbbggbwuw +rwururuuggwbugguwgwgrbubrgbrrbruguuwbbbuurg +gbbbrbgbwrrrgwrrwgrrrbubrggrwrgrgburrrruwwurw +guguugwbrgwugwwwbuwrrbugurbbbruubggwuuwguguwu +uwbggwbururwuwbrggbuwrwubuurbrugrurruwurubuggbbwwgww +rruuububwrruugrurubbbwwugrbruggbrugrrwwgwrguwbburubwwbwbrubg +bbwrggbgrrbuwwggwgwbubwgbwugwgbrurgbwbbbbbuuuubw +gbgbgwrrugggubgrrubwguwuuwwwwguubwggwuwgugwuuubu +rguuubuwbrbrwwgwggbugbubwrrruggwrwuuguwwggugrrbgrbrwwuww +rrgrggruggbgwgggbrgurggurburrurbuburbgrgbbubrwgru +gburrbwbrbuwugwwbbrggwbwwgrbbrwwuwgubbuwbwr +bgurwuggrwuwwwgrrgrwwgurbrbgbruggrbwbgurwbwwwg +bgbbgrubbruggrgrguwrbbgbwguwwubwbrrwwubgw +bgurguwrbbrrrbgrubrwrwgwggbbggbbubgrguggbwggbbugbgbwgrwuw +urugbbrbbbwugruwrwrggbgwbwwrwgrugwugbguwubgb +rgurrwbwwugggbgwubbwbwwwruguggwruuwrwrurbbrwwggbrrbgubbwubg +ugrgwruuruuggwrrurwwwguwwuggrwwgbruburbggbrb +uurgbgbgwgbwgrburrurrrruruurrubwbgurbwubguwgubwbwrbgrr +grbrggbbbgwbbuwwrbuwuruwwrgbuguwgbgrgrgrwwbwgrbw +wwruburuwggbrwbruwurrrgbbwwrwgguruwbrwubbr +bbwburbbrbwubrbwuruugrrwwgbubgugggrwugrbgurgwwgubg +ugbwwbrgubrrrurwgbgubrrbbrbggwburrwuuuuruwgurubgwgubg +wbwubrbgbrbgugrrguggwrrgwbugrwubgwgrrgbgrurbwrbrububwwgwubg +rrububggbrwbrubwubuuwwrbubrbuggwrbubgwwururrgwwurwr +wbrbrgbrbgubguugwruwrrgrwgguurugbguwubbuubwggrrggubwbb +rguuwbrururbwbubggugbwbwuwgggruubwbuubwrrrrug +ruwwggggwruwrurwgrguwwgurbgwrgwuuwrbrrwbgbuubrwubgbg +rugrgrwgbbrgwrggguggbwrugrrrbguwwbguwrbwwwrwugbgwwrwbr +wwubggbwubgrubwrbrgbrbwgbrggbwggggwggggguggrbr +bbuwgwgbbuwbuburgwgbgggugrgrrbrgurrguurugbbuurubggbg +rruwbwwwgurbgugbubwwwuwwuwbururgwwrrwubg +ubgbbuubwbwgrbbrbuwwuuwubrgugurbgruwurwwgu +grbwbubbrrruuuuuwuwrwugwuwgbubwbbwrbwbbubbg +urgrugbgbruwwburwrgrburbubrbbuwrrgwgbgrubg +ggububgubgwgbgguwrbrubwwburugwubuuwrgubg +brgwuugggbbuwbuuuwruwubrgguuugrggbwbwwrbugrwbguurugwgbu +wwwggugwwbbbgwgururugbgrwubgbwrwrggrubgrgwbrbrr +ggburgrrbrbwbrruwwwrwurgbwgrbrgguwrgubbubwwubg +buubugggwrbwrbbbgrbbgwwwwgbrrbbugggggbgguwbruwurwbrwbrgw +rbuurwgrwuuuwrggurbubbgbrgwrbwgrwbbuubgrrbwbwubruubg +wgwwbrrrgwbuubwgwgubwwggurggrrwugbugurrbugwbwrubbrgurbbgw +ugwguuugbrggggurubrbbgbrrwwbbwurrruwrugruwuwubwu +urrbbgwwbburrbrwbwggwrbbwbgwwbruwubrbwbgubbgwrgu diff --git a/src/holt59/aoc/inputs/tests/2024/day19.txt b/src/holt59/aoc/inputs/tests/2024/day19.txt index e69de29..29648be 100644 --- a/src/holt59/aoc/inputs/tests/2024/day19.txt +++ b/src/holt59/aoc/inputs/tests/2024/day19.txt @@ -0,0 +1,10 @@ +r, wr, b, g, bwu, rb, gb, br + +brwrr +bggr +gbbr +rrbgbr +ubwu +bwurrg +brgr +bbrgwb