From b315cdff0e25f06be9306872eb6d870898628327 Mon Sep 17 00:00:00 2001 From: Karl Spickermann Date: Sun, 20 Dec 2020 00:49:34 +0100 Subject: [PATCH] Day19 --- .idea/workspace.xml | 45 ++-- day19/day19.go | 75 ++++++ day19/day19Input.txt | 598 +++++++++++++++++++++++++++++++++++++++++++ day19/day19Test.txt | 12 + 4 files changed, 713 insertions(+), 17 deletions(-) create mode 100644 day19/day19.go create mode 100644 day19/day19Input.txt create mode 100644 day19/day19Test.txt diff --git a/.idea/workspace.xml b/.idea/workspace.xml index dd5ede8..7f49610 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -11,7 +11,8 @@ - + + - + @@ -133,7 +134,7 @@ - + @@ -143,6 +144,16 @@ + + + + + + + + + + @@ -263,12 +274,12 @@ - + + - @@ -291,11 +302,11 @@ - + - + @@ -304,26 +315,26 @@ - + - - + + - - + + - - + + - + @@ -340,10 +351,10 @@ - + - + diff --git a/day19/day19.go b/day19/day19.go new file mode 100644 index 0000000..e88b001 --- /dev/null +++ b/day19/day19.go @@ -0,0 +1,75 @@ +package main + +import ( + "AoC2020/helper" + "fmt" + "os" + "regexp" + "strings" +) + +func main() { + lineBreak := "\n" + args := os.Args[1:] + input, err := helper.GetFile(args[0]) + if err != nil { + fmt.Println(err) + } + parsedInput := strings.Split(input, lineBreak+lineBreak) + rulesInput := strings.Split(parsedInput[0], lineBreak) + messagesInput := strings.Split(parsedInput[1], lineBreak) + var rules = make(map[string]string) + for _, val := range rulesInput { + cleanS := strings.Replace(val, "\"","",-1) + parsedRule := strings.Split(cleanS,": ") + rules[parsedRule[0]] = parsedRule[1] + } + regex := getSummedRule(rules,"0") + fmt.Println(regex) + count := getValidMessages(regex, messagesInput) + fmt.Println(count) + rules["8"] = rules["8"] + " +" + newRule11 := rules["11"] + for i:= 0; i< 10; i++{ + newRule11 = "42 " + newRule11 + " 31" + rules["11"] = rules["11"] + " | " + newRule11 + } + regex = getSummedRule(rules,"0") + fmt.Println(regex) + count = getValidMessages(regex, messagesInput) + fmt.Println(count) + + +} + +func getValidMessages(regex string, messagesInput []string) int { + r, _ := regexp.Compile("^" + regex + "$") + count := 0 + for _, val := range messagesInput { + if r.MatchString(val) { + count++ + } + } + return count +} + +func getSummedRule(rules map[string]string, rule string) string{ + r, _ := regexp.Compile("[0-9]") + if rule == "+"{ + return rule + } + number := r.FindString(rules[rule]) + if number == "" { + return rules[rule] + } + + stringParts := strings.Split(rules[rule],"|") + newRule := "" + for _, val := range stringParts { + newRule += "|" + for _, s := range strings.Fields(val) { + newRule += getSummedRule(rules,s) + } + } + return "(" + newRule[1:] + ")" +} \ No newline at end of file diff --git a/day19/day19Input.txt b/day19/day19Input.txt new file mode 100644 index 0000000..c0756df --- /dev/null +++ b/day19/day19Input.txt @@ -0,0 +1,598 @@ +108: 117 50 | 63 64 +124: 50 64 | 64 64 +123: 64 119 | 50 85 +45: 60 64 +32: 20 50 | 79 64 +36: 97 64 | 70 50 +97: 50 64 | 64 50 +21: 50 104 | 64 83 +59: 50 124 | 64 83 +10: 115 64 | 34 50 +118: 50 124 | 64 4 +60: 12 50 | 4 64 +84: 29 64 | 99 50 +111: 64 27 | 50 14 +18: 64 101 | 50 29 +13: 64 45 | 50 1 +62: 64 97 | 50 83 +117: 124 64 | 70 50 +98: 50 4 | 64 124 +15: 64 114 | 50 12 +7: 100 64 | 56 50 +78: 99 50 | 52 64 +82: 114 64 | 97 50 +22: 6 64 | 4 50 +63: 12 50 | 114 64 +16: 64 52 | 50 70 +76: 50 46 | 64 13 +31: 64 69 | 50 67 +37: 21 50 | 128 64 +95: 68 64 | 16 50 +12: 64 50 | 50 30 +26: 50 12 | 64 83 +112: 113 50 | 72 64 +33: 104 64 | 52 50 +25: 70 64 | 114 50 +96: 51 64 | 105 50 +51: 50 47 | 64 26 +91: 103 50 | 9 64 +65: 66 64 | 23 50 +116: 64 114 | 50 97 +42: 64 54 | 50 40 +4: 50 64 +79: 50 97 | 64 29 +110: 64 116 | 50 118 +0: 8 11 +73: 50 12 | 64 101 +70: 50 50 | 64 50 +74: 61 50 | 65 64 +27: 50 107 | 64 90 +101: 30 30 +105: 17 50 | 24 64 +61: 58 64 | 102 50 +17: 50 83 | 64 29 +72: 30 97 +88: 64 38 | 50 2 +14: 50 36 | 64 2 +125: 64 50 | 64 64 +127: 95 64 | 28 50 +83: 64 64 +80: 64 107 | 50 81 +106: 50 101 | 64 29 +56: 88 64 | 49 50 +52: 50 50 | 64 64 +46: 80 50 | 120 64 +94: 68 64 | 33 50 +47: 50 114 | 64 6 +69: 44 64 | 57 50 +54: 74 64 | 3 50 +89: 50 83 +48: 106 64 | 59 50 +87: 86 50 | 37 64 +35: 64 73 | 50 55 +115: 50 99 | 64 70 +44: 111 50 | 109 64 +75: 78 50 | 22 64 +20: 64 101 | 50 6 +41: 50 4 | 64 101 +6: 64 50 +66: 50 93 | 64 115 +90: 64 101 | 50 124 +23: 50 82 | 64 77 +81: 50 114 | 64 101 +30: 50 | 64 +100: 122 50 | 75 64 +86: 50 73 | 64 18 +92: 64 48 | 50 71 +68: 6 50 | 114 64 +121: 50 70 +8: 42 +85: 64 112 | 50 110 +38: 64 104 | 50 4 +120: 84 50 | 55 64 +67: 64 7 | 50 53 +64: "a" +55: 50 52 | 64 125 +28: 89 50 | 84 64 +71: 50 39 | 64 16 +109: 43 64 | 94 50 +99: 50 50 +43: 41 64 | 77 50 +119: 64 108 | 50 35 +57: 87 50 | 96 64 +39: 64 97 | 50 6 +104: 50 64 | 64 30 +29: 50 64 | 50 50 +34: 83 50 | 125 64 +2: 99 64 | 124 50 +11: 42 31 +114: 64 64 | 30 50 +93: 50 97 | 64 101 +58: 50 33 | 64 121 +113: 64 99 | 50 70 +128: 64 4 | 50 125 +40: 123 64 | 76 50 +107: 50 52 | 64 83 +102: 126 50 | 25 64 +126: 50 125 | 64 97 +19: 50 124 | 64 114 +24: 114 64 | 29 50 +49: 20 30 +1: 64 19 | 50 15 +103: 26 50 | 18 64 +9: 64 117 | 50 62 +50: "b" +53: 91 64 | 5 50 +77: 6 64 | 99 50 +5: 32 64 | 10 50 +3: 64 92 | 50 127 +122: 115 64 | 98 50 + +bbabbaaabbabbaaaabbbbbbb +bbaabaaaaabbbaaaabaaabba +baabababbbbaaaaabbabaaba +baaabbbabaabbaaababaabbaaaaabbbb +bbbbaabbbabaabbabaabaaaa +aabaaaabaababbbbababaabb +bbabbbaaabbbbabbbbabbabbbbbbbbabaabaaaabaabaabbabbabbbbbaabaaaba +baaaaaaabaabbbaaaaaababb +aaabbabaaabbabbbabaaabba +abbbbbabbababaabbaaabbbaababbbbaababbabb +bababbaabbbbbbaababaaabaaabababbabababba +babbaabbbabaabbbbbaaabba +abbbbbabbbbaababbababaaa +aaabaaababbaaabbbbbabbaaaabbbbba +bbaabaaaabbbaaaabbabbbab +baabaabababbaaababbababa +abbbbbabababaaabbbbbbbba +aababbbababbababaaababababbbbbbabaaabaaa +bbbbabaabbabaabbbbabbbaa +aabaabbbbbbababbbabbbaba +abbababaabbbaabbbabaaaababbbaabababbaaaaababbaabbbaabbabbbabaaabbaabaabbbbaaabaa +baababaaabababaabaaabbabbbaaaabbabbabaab +bbbaaaaabaababaaaaabbaaabbbababbaaabaaba +bbababbabbbbbbabbbbabbbbbaabbbabaabbbbababbabaab +abbbbbabbbabaabbbabbaabaaababaab +bbbbabbbbaababaaaaabbbbabbabbbbbbabbbbaaabaabbabaabbabbb +abbaabbabaaabaaaaabbbbaaaaabbbbb +aabaababababbbabbbabbbaabaaaabaaaaabbbbbaabbbabbaaabbbab +abaabaaabababbaababbabab +aabaaaabbbaababbbbabaaab +bbbababbabbbbabaaaabababbbabbbabbbbaaaabaaabbbbbaabababbbbababbbbbabaabb +aabbaababaabaaaaabbbbbabbbaaabaaaabaabab +baabbaaaaaaabbabbbababab +abbbabaabaabbbabbabaaaabaabaaaababaabbbb +aabbbabaaabababaabbababb +abababbbabaaabbaaaaaaababbabaabbbabbaaaabbbbbaab +abbabbaabbbaabbbabbaabaa +baabababbaabbaaabaaababb +aababaabbbabbababbaabababaaaabbabaabbaab +bbaaaabbbbbbababaabbbaaaabaabaaabbbbbbba +abbaabbbbaababaaaabaabaa +aaaaaabbabbaabbbbaabbabb +bababababababaabaaabbaabbababaababaabaabababbaba +ababbbbabbbbabaaabbbbbba +babaaabaaabbababbabbbbaa +bbabbbbabbbbbbabaaababbbaaabbabbbabbabbababbabbbbaabbbaabbababaa +bbaabaaaaabbbabaabbabbba +babababababbaabaaabbbbbb +baabbbabaabaabbabaabbbbb +babbbbababbaaabbbaaabbaabababbaabababaabbbbbaaabaaaaaaaa +aabbbabbababbbbaaaaaabaa +bbbababbababbbbabbaaabba +aabbabbaababaabbbbaababa +abbabaaabbbaaaaabbbababaaabbababbabbbaab +babaaaaaaababababbbabbbbbbbbbbaa +abaaababbabbbbbabaabaabb +babbbabbabbbbbabababbbbaaababbab +aaabbbbabababaabababbbbaabababab +baaabaabbabaaaabbababbaabbbabbbaabbbabbb +babaaabbabbabbabbabbbaba +bbaabbbababbbbabaaaabaaaaabbabababaabaab +abaaabaaabaabababbaaaabbbabbabab +bbbaaaababbabbabaaaaabab +bbbbababbaaabbaaabaabbbb +abbbbabbbaaaaababbbbbbba +bababbabaababbbbbababaaa +bbababbabbbbabbbbbababaabbbbbbbbabbbbabbbbaababa +baaaaababaabababaabaaabb +baabaababaaabbaaabababab +baaaaaaabbbababbbbbaabbbaababaaa +ababaaabbabaabbbabababba +baaabbbaabbabaaabbaaaaabaaaabbabbabbbbbbbbbaabaa +bbbababbabbbaaabaababaab +aaaaaabbaabbbaaabaaaaabb +babaaabbbbabbaaabbabbaab +aaabbaabbbababaaabaabaababababab +aaabaabbbabbaaaaababaaabababaabb +bbaaaabbbaaabbbaaababaaa +bbabbbbabbbaababbabbabba +baabababaaababaababaaaaaaababbab +baabbaaaaaabaaabbbbbaaaa +babbaaababaabaaaaaaabbbb +babaaaaaaaaabbabaabbababaabbabbaababaaabbbaabbaaaaabbbbb +abababaabbabaabbbaabbaaabbaaaaaa +bbbbbbaaaaabbabbbabbaaaabaabbbaababbbbbbbaabbbbaabbbababaabbaaababaababbabbbbaaaaabaaaaaaabaabab +bbababaabbbbaabbbbaabbbbbbbbbbbabbbaabbabbbbbabbabaaabaaaaabaaaa +abbbaabbbbbaabbbbabaabaabababbbbabaabbab +babaababaaababaabbaabbbbaaabaaabaaababbbabbbaaaabbabbbbbbbaababaabaabbbbbbbbbaaaaaababaa +babaabaababaabaabbaabbbb +bbbbbaaabbababaaabaabbaaaaaaabbbabbabaabbaaaabba +babbbbbbaaabbbabbbbabaaa +abaabaaababbbbabaababbab +bbaaabaabaaaaaaaaaabbbabaabbbbbb +aaabbbabaaaaaabbaabbaabbbaabaabaaabbababaaabaaababbbabab +aaabbaabaabbabaabbbbabbabaaabaabbaabbabb +babababaabaabaaababbaaba +babbbbbbabababaabaabbaba +baabbbabbbaaaaabababbaabaabbbbaaababaabaabbaabaaaaaabbaabbaaabba +abbbabaaabbbaabbbbaaabba +baabbbabaabbbbaaaabbbbbb +bababbabaaaabaaaaabbbbaaababaaaaaaababbaaaabbbbbabaabbab +abbaabbbbbabbbbbaabbbaab +ababbbabababbbaaaabbbabbbbaabaabbbbaaabbbaababbaaaaabbbbbaabbabb +aaababaaabbaabbbabbbbaaa +bbbababbbabbbaaaaabbbbaabaaabbaabbabababaaaaabaa +babaabaaabbaabbbbbbbabaaabbaaabbbaababbaabbbbbbbbaabaaaa +bababaabaabaaaabbaaaabba +baabbbbabaabababbaaabbabbbaabbbaabbbbabaababaaaaababbabaaabaabaaaaaababb +aabbbabbbbabbaaaaaaaabba +bbbaaabbaabbababbaabaaaa +abbbbbababbaabbbbaaabaaabbbbbabbbaaababaaabbaaababaabaaabbbabbaabbbbbbababaababb +babbbbbbababbbaabbabbbab +abbaabbaaababbbabbaababa +aaabbbabbabaabaaabbaabbbabbaabbbaaaaaaaa +abbbbabbbbbbabababbaabab +bbbbababaaabababbbbbbbba +bbbabaabababbbabbaaaabbbbababbabbabababa +aababababbbababbbbaabaaaababbababbbbaaaaabbbbabaabaababbabbbaaabbabbaaaabbbbababbabaabab +aabbaaabababbbaaabbaabaabababaaaaaaabababbabaaab +bbaaaaabbabbbbbabbabbbab +babbaababbbbabbbbbabaaab +aabababaaabbababbbbbaaba +babbaaaabbbaabbbbbbbabaaabbbbbba +bbaabaabbbabbbbaabaaababbaabababaabaaaaa +abaaababbababbaaabbbbbbb +bbaaaabbabbabaaaababbabb +aaabababaababababaaabbbb +ababbaaaabbbaabbbaabababbaaabbababbabbbabbaaabbb +aababbbaabababbabbabbbabbbaabababbbaababbabaabbabaababaa +baaabbbababbbabbbbaabaababbbbabbbabababbaabbbbba +aabababbaababbbbabbbaaaababbbbabbbbaaabbbabbbabaabaababb +baaabbabababbaaabaaaabab +aababbbaaabaabbaababbabb +aaabbaaaaababbbbbaabbbbbbaaaabaa +bbbbbaaababaabaaabbaabbbbbabbbabaaaaabab +aababbbbaabaabbabbabbaab +bbbaaaabaaaabaababbbbbbb +abbabaaaaaaabaaababaaabaaaababbbabaaabbb +abbbaaabbabababaabbbbbaa +baababaaaaababababababaabaaabbbaabaabaaa +bbbbbbbbababbbbabbabbaab +ababbaabaabaabbbabbbbbbb +babaaababaabbaaaabbabbaaababbababbabbbaaababbbabbbabbbabbabbbabb +babaabbabbbaaababbaaaaaa +bababbbaabababaabababaabaaaaaabbbbbababa +bbbbaabbababaababaaaaaab +ababbabbbabbbbaabaabbbbb +aabababbabababbaababaabbbbbaabaaabbbbbababbbbbabbbbbabbbbababbabbaababaa +ababbbababbabbaabaaaaabb +babaabbbbabbabbbaaabbaabbaabbbababbbabba +abbbaaabbaababaabbabaaba +bbbabaabbabaabbbaabaabab +ababbaaaaabaaaabbbaaabab +baababababbabbaabbababab +abbbbbabbbbbaabbaaaaaaab +baaaabbbaababaaaaabaaabbababbababaaaaabbbaaaabaa +bbbaaabbabbbaaaababaaaaa +bbbbaabbbbabbaaabbaaaaba +aaaabbabaaabbabbaaaabbba +abaabaaabbbaaaababbaaabaabbbaaabbbababaaaabbaabbabbabaababbabbbb +aaabaabbbbaabaababbbaaababbbaaba +baaabbbbbabbababbabaabab +babbbabbabbabaaaaaaaaabbbbaaaaaa +ababbaaaabaababaaaabbbbb +bbbaaabbbaabaababaaabbaabbbbbbaaabbbbbaa +ababaaaabbbbbbbbabaabbaa +bababaababbbabaaaabbabaa +babbabaababbaaabbabbbbaababaababbbbaaaaaaaabaabaaaaaababbbabbbbaaaabbbaa +baaabaaaabbbabbabaababbb +babaaaaabababababaabbaabbaabbbbabbabbabbbbaaaabababbabbbaabbbaaa +baabaababbaabbbaaababbab +aabaabababaabbbabbbabaaaabaaabaababbabbbaaabbbbbbaabbbaabaaabbbbaababbbbaabbaabb +aabbbabbbbaabaaabbbbbabb +aaabbaabaabbabbabaaaabba +baaabbbaaaabbaaababbabba +abaabbbababbbbababbaaaaa +bbaaabaaabbbbababbbaababbbbbbaaaabbaababaaabbbbb +ababaaaabbbbbaabbababaabbbabbaaabbbbaaba +aabbabaaaabbbabbbaabbbbaababaababbbabbbbabaaabaabbaaaabbaabaaaaa +bbbabbababbaaabbbaabbaaabaabbbaaaabbbbaabbababaaaabababb +babaaababbbbbaaaaabaaabb +abbbabbabbbbaabbbbabbbaa +bbbbabbbababbaabbbabaaaa +abbbaabbbbbbbaaaabbababa +bababaabbbbbbbbbaaaaabbb +babaaaababaabababbaabbaa +abbbaabbabaababaabaaabaaabbbabaabbaababa +bababbababbabbaabbaaaaaa +babbaaaababbaaabbbabaaaa +bbbbbaaaaabbababaaaaabaa +abaababaabaaabaaabaababb +baabbbbababbaabbbbbbbaba +bbabbbbbbbaaaaabbbaaaaabbaabbbaabbbbaaabaaaabbaa +aaabbbaaaaaaabbbaaabaabbaaaaaaaabbbaaabbbbbbbaba +aabbbababbababbaaaaaabbb +bbaabaaaabbaaabbabbabbababaaabbabbaaabba +babbaabbabbbbabbbabbbaaabbbaabbbbabbbaababaabbabbabbbbaa +bbbaabbbaababababaaaaaab +bbaaabaababaaabbaabbabbb +aaabaabbbbabbbbbababaabb +babaabbbbbbaababaabbbabbabbbabaabbabbaaababbabba +babbbbbabaaabbbaaaaaabab +aaabbbbabbababaaababbbbb +abbbaaaabaaaaababbabbaba +baabaaabbbbabbbbaabbbbaababaaabbabaaabba +ababaababaababaaaaabbbaa +baaabbabaaabbaabbbbbabaaaaaabbaaaaaabaaabaabaabaabaaabbaaabbababaaabbababbaaaaba +baabaabaaaaaaabbabbabaaabbabaabbbbabbbbabbabbaabbbabbbabbaabaabb +aabbbaaabbbabbbbbbbbbbba +aaabaabbaababbbabbabaaaa +aaabbabbabbbbbbaaabbbbbbabbbbaaa +aabbbbaaaabababaaababbbaaaabaaaa +bbaabaabbbbbbabababaababbbbbabaabbbbabaaabbabaab +aaabaabbaabbabbabaaaaaab +baaaaabaababbbabbbbaaaaa +ababbaabaaabaabbabaaaaba +baabaabaabababaababaaabbbbabbabb +baabbbabbbababbaaababaaa +aabaaaabaabaaaabbabababb +babbaababaabaaabaaaabbba +abbaabbbaabbbaaabaaababa +aabbbabbaababbbbbbaababbbbbbbbaaabaaaabb +babbabbaababababbaaaabbbbaaaaaabbaaabbbbababbbabaabababa +baabaaabbababbabbbaababa +babbbabbbbabbbbbabbababa +aabbababbbbbbbbbabbaabab +bbbbbaabaabbabbaabaaaabb +babbbbbbbabaaaabaabbbabbbabaabbbbbababaabbbbaabbabaaabbb +bbabbbbaaaababbabaaaaaab +abaaaabababaabbaababaabb +aaabbbabababbaaaaabaabbaababbbaabaaabbab +aaaabbabbababbbabaabbaab +bbaaaaabbbaabaababbabbba +baaabaaabaabbbbaaabaaabb +aababbbbbbbababbbaaabbbbbbaaabba +aaaabaaabbbbbbbaabaabbab +aabaabbabbbaabbbaabbabbababaabbababbaaabaabaabaaabaaabba +baababaabababababbbbbaba +bbaabaaabaaabbababbababa +abbbaaaaaaababaabaaabbaabaaabbaaaabbaaba +abbabbabbbbaaabaabaababb +babbabbbaabbbaaaaaaababb +bbbabababbaabaabaaabaaaa +bbbabaaabaababbabbaaabbaabaabbaa +baaaaababbbbbaabbbabbabb +baabababbaaabbbabababbaaababbabbabbbbbbb +abbbaabbabaaaaaaabaaaaaaaaabbbbababbaaaaababbababaabbbbbbabbbaababbbbaaa +aaabbabbbaaaaaaabababaababaaaaab +babaaaaaaabbbababbbbabbbabbaabbbaaabbaaaaaaaaaab +aabbbabbbababbaabbbababaabbaabbabaaaaabb +babbaaabbaabbbaabaabbabb +abbaabbaaabababbababbaba +abbbbbabbbbbbbbbbaabbabb +bbbaabbbbabaabaababaababbabbbabaaabaaabb +baabbbbabbbbbbbbbbbbaabbababbabb +aaabbbbaabbabbaaaaaababa +aabaabbabbbaaabababbbbbaaaaaaababaabbaba +abbabbabbaabbbabaaaabbaabaabbabbababbbbbbbaaaaaaaaaababbbbbaaabaaabaaaaabaaaabaa +aaababaaaabbababbaabbbaabaababaaaabaaabaaaaabbaa +baabaaabaaaaaaaaaabaaabbbbbbaaab +abaaabaaaaaaaabbbbaaaaba +babbaaabbbaaabaababbbaba +babbbbbabbaabaababbababbbabbabbabbbbbaba +aaaaaabbbaaaaaaaabaaaabaabbaabbaabbabbbbbbababbbaaaabbbb +bbbaababababbaabbbbabaaa +aaaaabbabbaaaaabaaabbaabbbabbabaababaabbababbaaababbabaabbbaaabbabbbbabb +babaabaaaabbbaaaaabbaaab +bbbbabbbbaaabbbabbbaababaaabbaabbabbbaba +aabaabaaabaaaabbabbabababaaabbabbbaaaabbbbbbaaaaababbaabaaabaabaabbababb +ababbaaaababbaabbaaaabbabababaababbaaabb +abababababbbabbbaabbbaababbabaab +babbbbabbbbababbbbbbbbabbbababbb +aababbbbabaaaabaaabaabab +bbbaaababababbababaababb +bbbabbbbbabbbabbaabaabab +baaababbaaabbbaaabbbabaaabaabaaaaaaabaaaabaababa +bbbbbbbbbbabbbbbbbbbbbabaaabbbaaabbbbaab +babbabbbbbbbabbbbbaaabba +babaaababbbbabaaaaabaaabaababababbabaaab +abaababaababbaaabbabbbbbabbabbab +bbbabbbbaabaaaabbbabaabbaaababbaaababbbbabaaaabbbbbabbbabaaaabab +babbbbbbaaabaabbbbbabbbbbabaabaaabaaabaabaaababa +abbabbababbbbababbabaaab +ababbaaaabaaabaabbaababb +aabaaaabababaaaabbbbaabbabbbaaaaabbaaaab +babaaaaaabbbaaaabababaababbbabbababaabaababbbbaaaabaabab +abaaaaaababbaabaabbaaaaababbaabbbabbbbbbbaaaabbbabaabbabbbabababaaababba +aabbbabababbaabbababbabb +aaabbaaaabaabbbaababaabb +bbaabbbabbbbababaaabbbabbbbbabbabaaaaaabaabbbbaaaaabbaabbaaaaaaa +babaaaabaaabbabbaaabbaba +aabbbbaabbbabbaabbbbbbba +bbaaaaaaabaabbaaaabaaaba +abbbaaabbabbbbbbbbbbabaababaaabbbbaabaaaabbbbbbaabaabbaaabbbababbbbabbba +abbaabbbaabbabababaaaabaabbababbabbbabbb +abbaaabbbbaabaaabbbbabbbbabbbbbbbaababbb +bbabbbbaabbbaaaabbbaababbbababbababbabba +abaaabaaabaabaaabbabbbaa +aaabbbabbbbbababaaabaaba +aabaabbabbbaaaabbabbabba +abbaaabbbbaabaabbababaaa +aabbabababbaaaaaaaaaabbbabababaabbbaaabbbbbaaaaa +aaaabbabbaababaabaaabaab +bababbaaaaabbaaaabbabbbb +abbaabbbabaaababbbbaababbabbaaaaabbbaaababbaaabaabbbbbba +aabbbabaaaabaaabbaaaabaa +bababbaabababbaabaabbaba +bbaabbbbbbbbaaaaabaabbbb +bbbbbbabbabbbbbaabbbbaaa +bababbbabaaabaaabbbabaab +baaaabaaaabbbbabbabbabbaaaaabbaa +bbbbbbabbaabbbabaabbbaab +baabaabaabbbaabbaababbab +aaabbaaabbbbababaabbababbabaabbaabaabbbabbbabaab +baaaaaababbbbbbabbabababbbaaabbbaabaaaababbbabbbaababaabbbaaaaabbaabbbbbabbababb +abbbabbabbaaabaabaaabaab +abaabbbabababbabababaabaabbabbabaabbaaaabbbbaaaa +bbabbabbbbbbaaabaabaababababaabbabababba +abaabbabbababaaabbabbababbabaaaababaaaaaaaaaabaabbbbaabbbbbbabaaaaaababbbbabaabaaababbba +bbaabbaabbbbbbabbabaaaabababaabbabbabbabbabaaabb +abbbaabbbbbaabbaabbbabab +bbbbbaabaaaabaabbaaababbabaaaabbabababbb +aabbbbbabaabaababaaabbaaaabaabbaabababbbaaabbbbb +aaaabaaabbbabababaaabbaaaabbabababbaababaababbaaabaaabba +bbbbabaaababbaaabbabaabbbabbaaaaaaaaaaab +babbaaaababbbbbabbbabababaabaabb +baabababbbbbabbbabbabbba +babaabaaaaabbaaaaaaaaaaa +bbbaaaabbabbaabbbabbbaba +abbaaabababbbaaabbaababb +aaababaabbabaabbbababaaa +baaabbaaababbabbbabaaaaaabaabbbbaaabaabaababbbbbbbaaaabbaabbbaabababbabbababbaaa +bbaabaabbbbababaaabbaabbaaabababbbbabaaaaaaaaaabbaaaaabbababbbbb +aaababbaabababaabbbaaabbbbabbaab +aabbbabaabbbabaabaabaaaa +ababbaaababbaababbabbaba +babbabaabbaaabbbabbbaaaaaabaabababaabaaaabaaabbbabbaabbbbabbabbbabbbaaab +ababbaaaababbaaabbbbaaba +bababbaabaabaaababbaabab +babaabbaaabaabbaabbbbabbaababbbabaaaabaaaababaab +babbbaaaabbbbbabaabaaaabbbabaaaa +abaabaaabababbabbbabaaab +babaabbabbbbabaaabaaaabaabbabbabaaaabbab +aaabaabbaabbbababbabbbbbaaabaaaa +ababaababbbaabababbaaaaabababbbbaabbaaba +aabbbabbabbabaaaabaabbab +bbabbaaabababbaabbababbb +baabbababbababbaaaaabbbbaabbbabaabaabbbbbabaabaabbbbbaaa +aababbbabaaaaaabbaaabaab +bbbbabbbaaaabaaaababaaaabbaaaaaaababbabb +baababbbaabaababbbababbbbbbaababbbbbaaabaaabbababbabaaaaababaaabaaaaabbabbbababb +baababaabbbabbbbbaaaabab +abbaaababbbaaabbbabababb +bbaaaaabbabbaabbababbabb +aabaabbaababaabaaaabbaba +bbbaababaaabbbbaabbaabbbbaaabababbbbbaba +bbaabbbabbaabaabaaaaabaa +aabaaaabbaaabbababaabbbabbbaaabbaabaaabaaaaabbba +babbaaabbaaabbaabbabbabb +bbbaababaaabbbabbabaabab +aaababaabbaaabaaaabaabbaabaabbab +aaababbaabaabaabbaaaaabbbbabbaaaaaaabbababbbaaaabaabbaabaabbaabbbbbabbab +aaaaaaaaabbaabaababbbbbababaababbabbaabbababbbabaaaaaabaabbbabab +baaaaabbabaaaabbaaababbabaabbaababbbbbabaaababbbbbbbbaaaabaaabababbababbabbabaababababab +abaaaaabbaabababbabaaaababbbaaaabbaaaaaa +ababaaaabbbbbaaaababaababaabbabbbbaaabab +bbaaaabbaabbbabbabbaabab +baabaabaababaabaaaabaaba +baabbbabbbaabbaabbababaabbbaaabbbaaaabaabaabbbbbaabbabaaabbababbbbbbbaabbabbaaabababaabb +aaaabaaaabbaaababbabbaba +aabababbaaabbbababaababb +ababaaabababbbabbbabbbab +abbbabbaaaababaabaaabbaaababbbbaaabbabbaaaaaabaabaaabbbbbbaaabbaaaaaabba +baaaabbbbaabbababbabbbabbabaaaba +baabaabaaaaabbabaabaabbbbaaaabbaabaaabbb +abbaabbbababbaaababaaababbbaaababaaaaaabbbababab +aabbbbaaaaaabaababbaaaababaaabbbaabbbaaaabbbbbababbbaabaaaaabbabaaaaaaaa +baaaaaaabababaabababbaba +bababbbaaabbababbbaaaaba +aaababbaaabbabbaababbbbb +aabababbabbbbabaabbabaaaabaabbbabbababbabababbabaaaaabba +abbababbbaabaabbbaabbaaaabaaabbaababbbbbbbbbbabbaababbaabaabaababbbabbabaabbabbbbbaaaabbbbbababb +aabbabbaabaababaaaaaabba +aabbababaaababbaabaabbab +abbbbbaababbaababbababaabbaaaaaabaaabababaaaabbbbbaaabbb +aaaaabbabaababbaaabaabaa +babbbaaabaabbbbababaabbaabaaaaabbbabbbaaabbbabbbbabbbbaa +aaaabaabbabaaaababababba +abbbabbbaaaaabbbbbaabbaa +bbbaaaabbbaabbbababaaabbbbababaabbaaaaaa +aaaabaabbbbaaaabbbbabbab +aababbbbbaabababbbaaabba +baabbbbababbbabbaabbabbabbbababbaaaaabab +bbabbbbabaabbaaabaabbbbb +ababbaabbbababbabbababab +aaabababbbbababbabaaababbbabaaba +aaabababbaaabbbabbabbabb +bbbbbbabaabaaaabbbaaabab +abbabbaabbbabbaaabbaabbbaabaababaababbab +abbaabbababbaaaaabbaabbaaabaabbaaabbaaba +ababbbabbaababbbbabbbbaaaabbaaabaaaaaaab +baabbbbaaaababbbaabbbbbaaabaaaaa +bbbababababbaabaaaaaabaa +baabababbbbaabbababbbbbaaaababbaabaabbbaaabbabaabbaabbbb +aabbbaaabbbbbaabaaabbaba +babbbabbaabbaabbbaabbaab +bbbabaabbbbaabbaaaabbabbaaabababbbabbaaaabbbaabbbaaabaaababababb +bbbaaaabbbabbbbabbbabbba +aabbbabababaaaaabbbabbaaaabaaaba +bababbaababababaabaaaabb +bbbaaabbbbbaabbabbbbbbaabbaabbbb +abbbaabbbababaabbbaaaaba +abababaabaaabbbabaaabbabbabaaaabbbaaabab +bbbabbbbbbbaaaaabbbbababbbabaaabababbbbb +abaaaaaaababbaababbaaabaabbaaaab +bababaababbbabbabbabaaba +babbaababababaabbbbbbbbbabbababbbababbbb +bbbaaabbbbababaababbbaba +aaabbbbaabbbababbababaaaaaabbbbaababbbbbabaaababbbabbbaaaaaaaabaaaaaabaa +bbaabbbabbbbbbaaaaaaaaab +baaabbbabbbaaaaaaabbaaaa +aaaabaaaaabaabbaabbabbbb +abbbbabbbaababaaabababbbbaaabaabaaaaabaabbbbabbaabbabbbb +aaaabaabbbababbababbaabbbbabaabbbbbbaaab +bbbbbaaabbbaababbbbababbbbabaabbaabbbbba +aaabbbbababbbabbbbbaababbbbbbbbbbbabaabbaaaaabaa +aabbbabaababaaabbabbbaba +bbbaababbbbbbbbbabaabbaa +ababaaababbbbbabaaaaabab +bbbababbbababbbaabbababa +bababbbaabbbabbababbabaa +bbbababaabaaaabaaaaabbbb +ababaaabbbbaaaabbbabaaba +aaababaabbbaaabbbbbaaaababbabbbb +babbbbabbababbaaababaaaaabaababbabbbabbb +bababbabbabbabbbaabbababbaabbaaaaabbbaabaabbaabbbbaaabbaabbabbbabbbbbaab +babbaababaaabbaaababaaaabbbaabaa +bbabbbbabaabababbaaabaab +abbbaaabaaababbaabaabbab +bbbababbbbbabbbbbbabbabb +bbbbbaababaaaabaababaabb +abbabaaaabbbaaaababbbbab +ababbbabaaabbbabaabbbbaaaaabbbbbaabaaaba +bbaaabaaaaababaaabaabbbb +abaaabaababaaabbbaaabbaabbbbabaabbabbaab +bbbbbababbabaababaababbbaabbaabaaabaaaaaaabbbbba +aabbbabbabbaaababbababaabbbabababaaaaaaaaabaabaabaababba +abaaaababbbbbbababaabbbabbbaaaaaababbabb +babbbbbaaaaabbabbaaaaabb +aaabaababbaabbaaabbbbbabbbbababbaabbbbbababbbaab +abbabaaabbbabbaababbaabbaabbbbba +babaaabaabbbabbaaaaabbaa +baabbbbabaaaaababbbaabbbaaaabbbb +aabbaabbbbbaaaabbbbabbaaabbabbababbbbaababaababb +abaaaabbbbaaababbbbbbabb +abaaaabaababbbabaabaaabb +abaababbaabaababbaaabbbb +bbabbabbabababbaaaabbabaabababab +aaaaaabbbabaaaabbbbbbbaabaaaaabbaababbabbabbbababaaaabba +bbababbabaaababbababbbbbbabbabab +bbabbaaababbbbaababbaaab +baaaaaaaaabababbaabaabaa +abbaaabbabbbaaaababaaabaababaabaababaabb +abaaaaabaaababbaaaabaaab +abaaaaaabbaabaaaaaabbaabababbbaaabbbabbbbaabbaab +abbaaabbbbaabbaaaabbbaaabaabaaaa +aabaaaabbbbaaaabaaababbb +abbaabaabbbbababbabbaaababaaabbaaabaaaabbabababababababb \ No newline at end of file diff --git a/day19/day19Test.txt b/day19/day19Test.txt new file mode 100644 index 0000000..a76d890 --- /dev/null +++ b/day19/day19Test.txt @@ -0,0 +1,12 @@ +0: 4 1 5 +1: 2 3 | 3 2 +2: 4 4 | 5 5 +3: 4 5 | 5 4 +4: "a" +5: "b" + +ababbb +bababa +abbbab +aaabbb +aaaabbb \ No newline at end of file