summary refs log tree commit diff
path: root/19
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@gmail.com>2020-12-18 21:47:07 -0800
committerIrene Knapp <ireneista@gmail.com>2020-12-18 21:47:07 -0800
commit15d6c39addee644ea7d96c744e721225e63b03e2 (patch)
treeed6dc864f5d0140ca65bf23ce23858785fe6ee2b /19
parent781e65e5a4444800982da71d97cb6b05d7dca17e (diff)
19
Diffstat (limited to '19')
-rw-r--r--19/Cargo.toml11
-rw-r--r--19/input578
-rw-r--r--19/input.small12
-rw-r--r--19/src/main.rs127
-rw-r--r--19/tests/main.rs14
5 files changed, 742 insertions, 0 deletions
diff --git a/19/Cargo.toml b/19/Cargo.toml
new file mode 100644
index 0000000..0c97bfc
--- /dev/null
+++ b/19/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "advent_19"
+version = "0.1.0"
+authors = ["Irene Knapp <ireneista@gmail.com>"]
+edition = "2018"
+
+[dependencies]
+advent_lib = { path = "../lib" }
+
+[dev-dependencies]
+assert_cmd = "0.10"
diff --git a/19/input b/19/input
new file mode 100644
index 0000000..e62651d
--- /dev/null
+++ b/19/input
@@ -0,0 +1,578 @@
+77: 30 112 | 20 13
+121: 43 20 | 123 30
+42: 57 30 | 101 20
+30: "a"
+50: 65 20 | 134 30
+37: 89 20 | 43 30
+106: 16 30 | 54 20
+17: 30 84 | 20 35
+129: 89 20 | 96 30
+123: 30 30 | 20 95
+20: "b"
+115: 20 70 | 30 93
+112: 30 90 | 20 123
+4: 20 55 | 30 5
+72: 20 90 | 30 123
+51: 30 20 | 20 95
+24: 131 30 | 7 20
+94: 121 20 | 15 30
+117: 133 30 | 102 20
+92: 28 20 | 43 30
+70: 87 30 | 96 20
+88: 109 20 | 36 30
+35: 20 36 | 30 61
+96: 30 95 | 20 20
+47: 96 20 | 66 30
+6: 20 55 | 30 123
+130: 30 29 | 20 88
+68: 5 20 | 89 30
+66: 95 95
+75: 96 30 | 55 20
+3: 20 90 | 30 5
+7: 20 53 | 30 123
+86: 30 5 | 20 53
+105: 20 87
+46: 134 20 | 87 30
+102: 30 111 | 20 103
+93: 87 20 | 87 30
+79: 116 20 | 71 30
+8: 42
+33: 5 20 | 87 30
+107: 96 20 | 123 30
+90: 20 30
+110: 20 59 | 30 32
+16: 30 68 | 20 39
+52: 4 20 | 38 30
+71: 96 30 | 51 20
+38: 96 20 | 90 30
+28: 20 30 | 30 30
+27: 30 64 | 20 24
+91: 30 27 | 20 113
+1: 20 90 | 30 134
+54: 105 20 | 18 30
+0: 8 11
+73: 65 20 | 55 30
+132: 30 17 | 20 19
+41: 20 51 | 30 22
+45: 22 30 | 53 20
+14: 124 20 | 73 30
+22: 30 30
+23: 87 30 | 55 20
+10: 30 89 | 20 134
+120: 56 30 | 9 20
+11: 42 31
+109: 95 134
+127: 30 53 | 20 123
+61: 20 53 | 30 90
+103: 127 30 | 23 20
+116: 90 20 | 87 30
+134: 20 20 | 30 20
+114: 20 63 | 30 41
+64: 20 118 | 30 25
+12: 30 48 | 20 3
+111: 20 23 | 30 72
+60: 79 30 | 120 20
+59: 20 28 | 30 87
+65: 20 30 | 20 20
+44: 89 30 | 28 20
+18: 65 20 | 43 30
+32: 95 123
+83: 30 66 | 20 22
+63: 20 123 | 30 55
+48: 30 134 | 20 43
+99: 20 12 | 30 125
+43: 20 20
+133: 20 100 | 30 110
+80: 20 50 | 30 44
+125: 20 98 | 30 86
+135: 128 30 | 130 20
+131: 20 55 | 30 134
+122: 97 30 | 60 20
+25: 30 43 | 20 51
+95: 20 | 30
+55: 30 95 | 20 30
+13: 43 20 | 43 30
+21: 20 76 | 30 80
+98: 89 30 | 65 20
+81: 106 30 | 85 20
+53: 30 30 | 20 20
+78: 45 30 | 37 20
+89: 20 30 | 30 20
+9: 96 30 | 43 20
+31: 2 20 | 82 30
+56: 5 20 | 96 30
+76: 1 20 | 23 30
+62: 92 30 | 10 20
+58: 30 22 | 20 43
+85: 77 20 | 67 30
+26: 30 58 | 20 6
+101: 30 81 | 20 91
+29: 83 30 | 47 20
+126: 20 53 | 30 55
+2: 122 20 | 135 30
+15: 5 30 | 51 20
+34: 20 37 | 30 116
+82: 30 104 | 20 132
+19: 40 20 | 62 30
+108: 21 20 | 119 30
+36: 30 22 | 20 87
+104: 69 30 | 99 20
+100: 20 7 | 30 61
+39: 89 20
+87: 30 20
+113: 52 30 | 34 20
+5: 30 30 | 30 20
+40: 4 30 | 107 20
+97: 20 26 | 30 78
+67: 30 131 | 20 126
+118: 20 134 | 30 66
+124: 96 30 | 22 20
+128: 30 114 | 20 14
+119: 30 49 | 20 74
+84: 129 30 | 33 20
+74: 30 6 | 20 46
+49: 30 38 | 20 75
+57: 117 30 | 108 20
+69: 20 94 | 30 115
+
+aaabbaababbababbabaabbbaaabbbbaa
+baabaabaaaabbabbbbbaaabb
+aabbbaaabaaaabbbbaabbaaa
+bababbbabbabbaaaaabababbbbaaaaaaaaabbaabaaaaabababaaabbaababbaab
+baababbbbbbaaaababaaaababbabbaaaaabbbbbbbabaabaaaaabbbbb
+abbaaabababbaaaabbaabababbbabbaa
+aaabaaabaaabaaaaaaabbbab
+abaaabaabbababababaaabba
+aabbbbbbaaabbaaaabbabbbb
+aabbbabaaaababaabbbababb
+aaabbabbbaabbabbabaabbba
+bbbaaaabbbabbbaaababbaabaaabaaaabbbbabba
+babbbbaaaaabaaaabaaababbbabbaabbbaababbaabaaabab
+aabaaaaabbaaaaaabbababbbbabaaaaabbaaaabb
+bbbbababaaabbaaaaababbaa
+baabaaabbbbbababababaabbaaabbabbaabbbaab
+bbaabbabbbabbbaababbbbbabaabaabbbababababaaabaaa
+baabbbbbaaaabbbabbbbbbbb
+bbabbaabbbabbaaabbbaabaabaaabbbbaababaaa
+babbbaababbbabbababaabbb
+aabbbbbabbbbaaaabbbaabababababbb
+aabbabaababababababbaaabaaabaabb
+aabababbaaaaaaaababbbbaaabaaaaaa
+abbbababaaabbaabababababbaaabbbbaaabaabb
+baabbabaaabaaaaabbbbbaabababaaaa
+abbbbabbbababbababbaabbbbaaaabba
+abababbababaaabbabaabbbb
+aaaabbbaaaaaabaabaaabbba
+bbaabaababaaaabbaaaaaabb
+aaabbabbaabaabbbaabbaaba
+aaaaabaabbaabaababbabaaa
+bbabbbbabbbaabbbabbbbaab
+aaabbabbbaaabbbbbaabaabbbabababbaaaaaababbbbaabb
+abaabbabbabaaabababaababaabbabbbabbbbaaaaabbbbaabbaaaaababbbabbaabbbbbabaabaabbabbbbbaabaaaabbab
+bbbaababaaaabababaaaaaab
+bbbbabbbaaababbbaabbbbbb
+babbbaabaababbbaabbbbbaa
+abababbabbbabbabbbbabaaa
+abaabaaaaabaabbabaaabbbbbbababab
+abababbaaabababbbababaaa
+baaabbabbbbbbabababbaaababbbbabbbaababbbaabbbbabbbaaabbabbbbbbab
+aababbbaabababaaaaaaabab
+baaabbababbaaaababbabbbabaaabaaabaabbbbaaabbabaabbbaabbbabbabbabaabbaaab
+baaaabaabbababbbbbbbbababaaabaab
+bbabbaababbabaabaaabaaabaaaabbaaabbbbaab
+bbbaaaaaabbaaaaabaaaaaaa
+bbabbbaababbbaaaababababbbaabaabbbbbababbaaabbbaabbaaaabbaaaaaaa
+abbbbabbaabbabbbaaaaabba
+babbababbaaabbabbabbaabaaaaaaaba
+bbbbababbababbbbabbababbaaababab
+abbaaaababbabbbbbabbaaabaababaab
+aabbbbbbabaabababbbabaaa
+aaaaaaaababaaabaabaabbaaabbabbbaabaaaaaabbaabbba
+abbbababaaaaabaaaababbbaaaabbaaa
+bbbbbabbaabaaaaaaabaabbaaaaabbaa
+ababbabababbbaabababbbaaabaabbbb
+ababaabaabbabbbabbbabbbabbaaaababaabbaaa
+ababaabaaaababbbbaaaabaabababbaaabbababb
+aaabbbaabaabbbbbbaaababbaaaabbbabbbbbbbb
+aaababbbaaaabaabbababaab
+aabbbabaababbbabbaaaabab
+abaabbbbbbabaabaaababababbbabaabbaabbaabaabababbabbaaaababaaaaaa
+abbaaaababaaaabaabbbbbabbbaaabaaaabbabaa
+babaaaaabbbaabababaaabbb
+abbbbbbaabaabaaabbaaaaaabbabbbaabbabbbbbaabbbbababbababb
+baabbababbbabbababbbbbaa
+bbabaababbbabbabaabbbaab
+ababbbabbbbbabaabaaaaabb
+babbbbbbbaaaabbbabbbbaba
+babbabaabaaabbababaababaababaaab
+aaaababaaaababaaabbbabbaabbaaaabaaaabbab
+abbaabbbbbabbabbababbbbbbbbabbaabaaaababbbbaabbabaaaabbbbabaaaabaaaabbab
+baabbbbabaabbbbabaaabaaa
+aaabbaaaaaabbabaabaaaaab
+abbabaabbaaababbaabbabab
+aabaabbbbaababbabbbbbaaabbbaaabb
+aaaaaaaaaabbabbbaabaaabbabaaabababbbaababbaaabababbbbaaaaaabbbababaaaaaa
+babbabababaaaababaaaabba
+abbaaaaaaaabbaaabbbaabaaabaaaabbabaabaaabbbaabbbbbbaabbbbbaabababababaab
+bbabaababaabbabbbbaaaaba
+bbabbbaaaabaaabbbbbabbbaaabbbbba
+babbbaaaaabbaaaababbbabb
+bababbabbbaabaabbbbaaaaabaabbbab
+bbbaaaaabababbaabaaaaaab
+babababbbaabaaaaaaaabbbaabbbabbb
+aaaaabaabbabbababbaabbba
+aabababbabbabbaabbbaabbb
+baaababbaabbaaaaaabbbabb
+bbaababbaaabbbaababababbaabbaaabaaababab
+baaaabaaababababaabbabbbabababbaaababbbbbbbaabba
+babbbbabbbabbababaabaaabbbbaaaabababaaab
+baaaaabaaabbbbaaabbaabbaabaabbbabababbabbaaabaaaaaabaaababaabbabbabaaaaaaaabbbbb
+babbbaaaabbbbbbbaaaababbaabbbbbbbbbaaaabbbabbbbabaababaa
+baabbbbbabababbaabababaabaabaabaaababbbbbbaabbaa
+babaaababaaaaabaaabaabbabaaabbabbaaaabaabbbaabbbbbabaaabaaaaabbabbbabaab
+abbabaaababaabaaabaaabaaababbbaababbababbaaabaaababbaaaa
+ababaabaabbababaaaabbbbb
+baababbabaabbbbbbbbaabaaababaaabbbbbbbaa
+aabbaaabbbbababbababbaaa
+babaabbabbbbbabbabbbbaba
+abbbabbbbaaababbabaabbaabbbabaaa
+babbbaaabaaaabaaaaabaaabbaaabbbbbabbaabaabaaabba
+bbbbabbbbabbaababbabbbbb
+bbbbaaaabaabbbabbbbabbaaaabbbaab
+babbbbbababababaaaaabaaa
+babbaabbbabaabbababaaaab
+abbbabbabbababbbaabbbbaa
+aaabbaababbbabbbbbaabaaa
+babbaabaabaabaaaaaaaaaaabababbba
+aabaaaababaaaabaababbbababbbababaabababa
+bbbabbbbaaababbaabbbaaaabbbbbaabbabbbbbaaaabbbbaabbbaabb
+abbabababbabbaaaabaabbba
+abbaaaabbaaaabbabbbababaabbbabaa
+abbaaabbbbaaababbbbaaaabbabbbbbabbbababbaababbab
+baaababbababaababbbbabaaaabbababbaaabaaa
+babbaaabbaabbbbbaabaaaaababbabaabaaabaabaabbbabbbabaabaa
+aaababbbaaaababaababbaab
+baaaabbbbaabbbaaabbaabbb
+babbbaabaabbabababaaaaabaabbaabababaabbb
+abbabbbbabababbababbaabaaaaaaaababbaaabbabbbbbaabbbabbabbbbababb
+baaabbbbabbbaaaabbbaabba
+abababaabaabaabbbbbabbbaaaabbababaabbbaabbababab
+aaaabaababababbaaababbbabbabbaabaabbbbabbbbbbbaaabaaaaaa
+aabaaabababbbaabbbbbbbaa
+aabaaaabbaabaaaaaaaaabba
+babababbaabbbaaaabbaaaba
+abbabbbaaaababaaaabaaaaaaabbbbbbabaaabbb
+bbbaaabaaabaababbbbaabba
+bbabaababbbbbabbaaaababaaabaaaaaabbbbaaabbaabaaa
+aaaababbbababbababbbbbbaaaabaaaaabbaaabaabbbbbaabababaab
+baabbbbbaabaaaababbabbaaaaaabaaa
+bbbbbaabbbbbabaababbbaaabababbbbbbbaaaaaabbbbaba
+ababbaabaabbaabbaaaabbbb
+bbbbbaabaabbbbbbbaaaaaaa
+bbbbbaaabbbbabbbaabaaabbbabaabbb
+bbbbbaabaaababbaaaabbaaabbbbababbabaabbabbbaaabbaaaaabbb
+baabbbaabaabbababbababbabaaaabab
+abaababbabbabbaaababbbba
+aaabbaababbabababababaaabbabbbbb
+aaababbbbabbabaaabaabaaabbbbaaba
+baaababbbabbaaabbaabaaaabbbababb
+abbbbbbaabbbabbaaabaaaabbbababbbaaabbbab
+bbbbbababbbaababbababaab
+aaaababababbbaaaabababbb
+bbabbaababbababaaabaaababbbbababbbbbbbabbbaaabbb
+abbbbbbbaabaabbaaabbbaab
+bbbaababbbbbbaaaaaaabbab
+babbbbbaaaaababbaaaaaabb
+baabbbaabaabbababbabbabb
+baabbababbbaababaabbabba
+baababbabaaabbabbaaababbbabbbbbbbaababbbbabbbabbbababaab
+bbaaabaaaaababbaaaabbbab
+babaabbaabbbbbbbbabaabbb
+ababaabaaaabbbaaabababaaaabaaabbbaaaaabb
+baabbabbaabbaabbaaaabababbabaaab
+aabaabbbaaababbbabbbbaab
+bbbbbaaaaaabbabababbbbaaaabbbabb
+baaabaabbaaabbbabaabaaababaabababbbababababbaaababaabaabbbbabbabaaabbabbaabbaaabaaabaaab
+aabbbbbbaabaaabbbbabbaaabaaaaabaabbbaaaababaabaa
+aaaabaabbababbabbbbabbbbaabbbababbbaaabaababaaaaabbabbab
+babaababaaaabaabbaabaabbbaabbababbabbbbb
+bbbaababbbbaabaaabbbabbbabbaaaba
+baaaabbabbbbaaaaaaaaabbbbbabababbbbababaaababbbabbababababbbbbba
+abbbabaaabaabbbaaabaabaabbbbbbab
+babaaaaabaabaabaaaabaabb
+aabababbabaabaaaaaaabbbabbaabbabaaaabbabbaaabbba
+ababbbabbbbbbaaaaaabbaababbbaaaaaaaaabba
+baabbabbbbabbaababbabbaaabaabbba
+bbaaababbabbabbabbabbaabaaaaaababaabaaabaababaaa
+baabbbbbbbbaabaaabbabaaa
+abbabababaaabbabbaaaabab
+ababbababaabaaabaabbbbbbbbbabaab
+baabababbaaaabbababbaaaaabaabbaa
+abbaaabbabbabbabaaaaabbbbabbbbaaababbbbbaababbabbaababbaabbbabba
+abbbbababbabaabaabbaaaabbaabbabaaabbaababaaabaababaaaabbabababba
+babbaaabbbabbabaaaabbbab
+aabbbaaaabbbbabbaaabbbbb
+baababbbbaaabbababbbabbbbbaaabaaaabbaaaaaaaabbab
+babaabababababbababbbbbaabbabaaa
+babaaabaaaabbabbaabaaababbaabaabbaababbbabaabbbabbbbabbaabbaabaa
+baababbabababbabbbabbaabbaabbbaabbbababb
+baabaabbababaabbaabbaaaaaaaaabba
+aaaababbbabbaababbbbaaba
+bbbabbbaaaaababbaabbbbaa
+abaaaabaaaaaaaaaaaabbaaaabaabbab
+ababbaabbabbaaaabbbbaaab
+baaabbbbabbbaabababaabababaabbbb
+baabaabaaabaaabbbbbaabaaaabaababaabbbbba
+bbbbabaababbbaabaaaaaabbbaaababa
+abbabababaabbabbababbabb
+babababababaaaaaabbbbbaa
+aabbbbbbbabaaaaabbbaaaaaabababbbabbbaabbababbaaa
+babababaabaababaababaaab
+baababbabaabbbbaaaabbbaabaaabbabababaababaaabaabababbbbbbbabababbaaabbaa
+abbbaabaaabbbabaaaabbbbb
+bbabbabaabbabbbaaabbabbbaababbababbabaaa
+abbaababaaababbbabbbbbab
+aaababbababaaabbabbababb
+baaaaabababaaabbbaabbbaabaaabaaa
+aabaaaabbbbbababaaababbb
+abaaaabbbabbabbaabbbbbbbabbaabbb
+bababaaababbbbaaaaaabababaaaababbaabbbabbaaabbabaabaaaaababaaaabaabaabbabbbaaabbaababaab
+aabbabbbabbaaaaaaaababab
+bbbaaaaaababbaabababbbba
+ababababbbababbbaaabbaabbababbbabbaabbaa
+aabbabaabaaabaabaaabaabaaaabaabbbbababbaaaababababbbbbabbbaabaaababbaabababaaaabbaaaaaba
+abbbbabbbbaaaaaabbaabaaa
+aaaababbbabaaabbbabaababaaabaaabaaaaabbb
+ababbbaaabbabbaabbaaabbb
+abaaaabbbaabbbaaaaabaaabbbabbbba
+aaabaaaaaaabbabaabbabbaababbbbbaabaabbbb
+aaabbabbbabbbaababaababbaaaaabbbaababbbb
+aabaabaabaaaabbabaaabbaaabbabaaaaabbabbbbbabaaaabbbababbaabaabbb
+abaabbaababbaaabbabaaabbbabaabbabbabbabaabbbbbabaababbaa
+ababbbabbbbabbbbbaaaabbbabbabbbaaaaaaaab
+abbbabbabaaabbababbbababaaabbaabaaaaabba
+abaaaabababaaaaabbaabaabaababaaa
+bbbbbbabbabbbbaaaaabbbabbbaaaabaaabaabab
+bbbaaaaaabbbbbbbaabababa
+baabaaaabbbabbbaabababbb
+aabbbabaaaaaabaabbbabbaa
+babaaabbaaaaabaaabbbbbbbbabaaabbaaaaabab
+bababbbbbaabbabbbbaaabbb
+bbaabbbaabbabbbbaabbbabb
+abbabaabbabbaabaaababaaa
+bababbaabaabaabbabbabbab
+bbbaababbabbabaabaabbbbabaaaaabbbbbbaaab
+bbbaababbabbbbaabababbba
+babbaabbbabbabaaaabbabbbbabaaaabbbbababb
+bbaabaababaabaaaababaaababaaabbaababbbbb
+abbbabbbaababaaaaaabbabbabababaaaaababaaaaababbabbaababb
+abbaaabbbaabbabbabaabbaaaababbbabbaabaabababbbabaaabbbab
+abbbaaaaaabbbaaabbaaabbb
+bbbbbabbabbabbaaabbabbbb
+baabbabaaaaabababaaaaaab
+aaaababbbbbabbbaaaababaabababbbb
+abbbabaabbbababbbbabbbaaaaaaabaaaaaaabbbaaababab
+baaabbbbaaabbaabbaaabbababbaababbbbaaaba
+bbaababbbbbbbababaaababbabbabbbaaabbbabaabbbabbbbaaabaabaaabaaba
+aaabaaaabbbbabbbbabbbabb
+bbabbaababaababababbabbb
+babbaaababbbbabbabbbaaabaabbabba
+bbabbaabbabbabaababaaaaaaababbabbaaabbaababbbbbaababbbabaababbabbbabbbaabbbabbbbabaabbab
+baabaaaaabaaaabbabbbbbbbaabbbaaabaaabbabbabbabbaaaaaaababaaababaaaaaabbb
+bbaabbabbbaaabaabbaababa
+aababbbabbbaabaaaaabbbab
+baabbbbaabbabbaabbaaaabb
+bbabbaabbaaaabaaaaaabbbb
+baabaabaaabaabbaabababbb
+abaabbaabbaabaabbbaabbabaaabbbaaaaaaabbb
+bbbbbababbaaababbaabbaaa
+bbaabbabbbabbaaabaabbbab
+bbbaaaaaabbbbbbbaabbabaa
+bbaaababbbabaabbaabbaaaaaaabbbbbbaaababaabbbbbbbbabaabaaaabbabab
+aabbaabbbabbaaabaabbaaaabbababab
+abbbabbaaaababbaabbaaaaa
+aaabbabbbbaabaabbbabbaaaabbaaabbbabbbaba
+abaabaaababbababaaababbbaabbbabb
+abaaaabababbbbbbaaabaaaaabababbaaabbbbab
+abbaabbbbbabbbbabbbaaababbabaaabbbabbbab
+babbbbbbbabaabbabaababbaabaabaaaabbbabaababbbbab
+bbbabbbbaabbaaaaabbaabaa
+bbbbbaaababababbbaaababa
+baabbbaabaabbababbbaababbbababbbabaabbbb
+bbaababbbabaaabbabbbaaab
+baabaaaaabbaaaaabbbaaaabbabbabbaaabbbaaaaabaabbbbbbbaaba
+abbbababaaaaabaaababbabb
+aaaaabaababbaaabaaaababbbaaabbbbababaaaa
+ababbaababbabbbababbabbabbabbaababaaaaabbbbbaaaabbbaaaba
+baaabaaabbbbabaaaababbaabbbaaabaababbabbaaabaaba
+bababbaaababababaabbabbbaabaabaaabaaabbaabbbaaaaabbbabaa
+abbaaabbabbaababbbaaaaaabbaaaabb
+bbaabaabbbbaaaaabababababbabbbaaaaabbbba
+bbaababbabbababaabbbaababbabbabbbbabaaab
+abababaaabbbaaaabababbaaabbbaaababaaaaab
+abbabaababbbbabbbbaabbbb
+ababbaabbabbabababaaabbb
+aababbbabababaababbbbbbaababbabbaababbbbbbbbaaaababbaabbbaaaaabb
+abbbaaaaaabababbababbbba
+babbabaaaaabbbaabaaabbaa
+aabaaababaabbbaaaabaaababaaababbabbbaaaaaaaabbaa
+bbaabbabbbabbabaaabbaaba
+bababbaabbbaababbaaaabaaabbbbaab
+bbbabbbabbbabbababbbaaab
+abbbbbbbaabbabbbaaaabaabaabbaaabaaaabbbb
+bbbbbabbbaababbbaabbaaba
+ababababababababababbabb
+baaaaaaabbabbaababaaabbb
+bababbaaabbabababababbabaabaabbabbaababaababbbbb
+bbabbaaabbbbaabaababababaabbbbabbabaabbbbaabbbaabbaaaababaabaabb
+abbababaabaaaabbbabaaaab
+bbabaabababbaabbbabbbbbbabbbbaabaabaabaa
+bababbaaaabaaaaabbbbaabb
+bbaabbabaabaabbbbabaabbaababaaababbaaaab
+babaaabaaabaaaabababaabababbbaba
+babbbbbaabababbaaaabbaabbabbabaabbaabbbb
+abbababaabababaababaaababbbabbaa
+aabaaaaaabbabbaabbabaababaababbaabaaabbb
+abaabbaabbbbbaaaabbaabba
+babaabbabaabbbbbbbabbbaababbbaabbbbababbaabbbaaabababbbbbaaababaabbbabbabbaaaabbaababaabaaaabbba
+aaaabbbabbaaababaaabbaaaabababaababbbbababbaabbb
+baabbabaabbaababaabbabab
+ababaabbaabaaabaabbababb
+aabbbababbaabbabaaaaabaa
+ababaababbbabbbbbaaaabab
+ababaababaaaaababbbabbbaabbbabaa
+abaabbaaabbabababbbbabba
+babbbbbabbaaaaaaaaaaabab
+bbabbababbbabbbbababbbbb
+abaababbabbaaabbbbbbababbbbbaaaa
+abaaaabbbababbbbaababbbb
+baabaababababbbbababbabb
+baaaabaaaaabbabbabbabababaabbababbbbabaaabaaababbabbaaaa
+aaaaaaaabbbabaaabbabbabaaabbbbaaabaaababababbabbabababab
+bbbaaaabaaabaaaaaabaabbbbababaab
+baabbbbabaaaaabaabbbaabb
+abaaaabaabbaaaaaabaababbbaaabbba
+ababbbaabbbaabaaaaababab
+aaababbabbbbbabbabbbaaaabababaab
+bbbbabbbbababbabaabbbbba
+baaabbbbbbbbbaaabbaaabaaabaaabbaaababbab
+bbabbaabababbbbbbbbaaabbabbbaaba
+aaabbababaabaaabbaababbbbbaabbababbaaabbbbabbabbaabbbbab
+abbaaaaabbabbaaaabbababb
+baabaabbbaabbabababbaaabbaaaaababaaaabbabbbbbbaa
+babbaabaaabababbbabbabaaabaaaaabbbaaabbb
+babababbaabbaabbbbbbaaab
+babaaababbbaabaaaaaabaabbbbaaaabababbaaa
+aaabbbbbbbabababaabbabba
+baaabbaaaaabbbbaaababbaaabbaaaaabbabbbbbabbbabbbbbbaaaaabbaaaababaaabbbbbaabbaababbbbbbababbaaaa
+ababbababaabbabaababbbababaababbabbbaaaabbbbbbaaabbababb
+babababababababaaaaabbab
+aaabbaaaabbbbabbabaaabbb
+babbbaaabababbaabaabaabaabbaababaaaabaaaababaaab
+babaaaaaabbbbabbbbaabbba
+bbabbaabaabbbaaaaabaaabaabbbababaabbaabaababaaaaababbbba
+aabbbabaabbabbbababbaaaa
+baaaabaababbabaabbbaabbb
+aaabbabaaaabaaabaabbaaaabbaabbaa
+abaabaaaabbabbaabbaababbabababbabbbbaabbbbaabbba
+bbbaaaaabbabbabaabaaabaa
+ababbbabbabbaababbaabbaa
+aaabbaaaababbbabbaabbaaa
+aaaaabaaabbabbaaabbbbaab
+bbbaaaababaabaaabbbabbbabaabaaaabaabbbaaabbabaabaaaabbbb
+babaaabababbbbbaaaaabbaa
+baabaabbbabaabaabbaaaaab
+baababbbbaaabbabaababbbb
+bbaababbbbababbabbabbbbb
+abbaababaabaabbaabbbbbbbbbaabbbbbbaababa
+babaaaaaaaababbaabaaabab
+babaaaaabbaabbaabaabbaabbbaabaaabbbbaabbbbbaabba
+bbbaaabaaabbbabbabbaabbb
+bbbbabababbaaaaaaabbbaaabbbbabaabbaaaaaabbbbaaaa
+bbbaaaaaabaabaaabaaababa
+aaabbababaaabbabbabaaaaaaaababababbbbaab
+babbbbbabababbababaaabbb
+aabababbaabbabbbbbbbbbba
+abbabbaaabaababbbabbabbaaaaabaabaabbbbba
+babbabbaabababbabababbbbaaababaaabbaaabbaabaabaa
+aaaaaaaabbbabbbaabaaabba
+baaaabaaabbbbbbaaabaabbbbbbbaaaa
+abbbaaaabababaaabbbbbabbabaaabaaaaababbbabaababaabaaaaaa
+abaababbabbbbbbaaabbabbbabbaaaab
+abbabbbababbaaabbbabaaaabaababaaabbaabba
+aaaabaabbbababbbbabbbbaabbbabbababaaaaab
+abbaaabbabaababbbaabaababaaababa
+abababababbaaabbbaaabbababaabaab
+baaabbabaabaabbaaabababa
+bbaaabaaaaaaabaababbaabb
+ababbabaaabbabaaaabababa
+babbbbaabbbbbaabbbaababa
+babaaaababaabbababbabbbaabaaabababbabbaaaabbaabb
+baaababbaaabaaabaabbabbbbaaaaaab
+abaabbaabbabbaabaabababbabbabbbb
+bbbaababaababbbabbababab
+baababbabaaaabaaabababbababaaaab
+babbaababbabaaaaababbaaa
+aababbbaaabababbaabaabab
+bbaabbabaabbbbbbbbababbbaaaabbbabbbbaaba
+bbaaababbbaaabaabbbaaabaababbbbababbbabbababbbbaabaabbba
+bbabaaaaaabbbababbaaabbb
+baaaabaabaabbababaabaaababbbaabbbbabbaabbbbabbabaaababaaaabbaaaaaaaabbabaabbbabaabbabbaa
+abaaaabbaabbabaaaabbbababbabaaaaaabbaaba
+baaaaaabbbabbbbaabbbbbbbbbabaabbbabbabababaabababbbbaaabaaaabbbababbbbaa
+aaaaaaaaaabbbabaaabbaaab
+aababbbababaabbaaaabbbababbbaabb
+abbbbabbaaabbbaaababaabbbabababa
+aaaaabaabaaaabaaabbaabaa
+bababbabbabaababbabbbabb
+abbbbabbbaabbbabbbbaabaabbbaabbaaaaababaaaaaaaaababaaaba
+aabaaababbbaabaabaabaaaabbbbaaababbbbaba
+abbabaabbbaaababaaabaaba
+bbaaababbbbbbaababbbabaa
+bbabaaaababbbaaaabaaaaaa
+aaabbaaabbabaababaaaabba
+baabbabaaabbaaaaabbbbaba
+baabaabababbaabbbbababaa
+aaaabaabbbaaababaabbaabbabbbaaaaabaabaab
+aaababbbaabaaaabbaaaabbbbabbbbba
+aaabbbaababbaababbaaaaba
+bbbabbbababbbaabbbaababa
+abbbaaaabbabbbaaabbaabaa
+aaaaaabbbbabbaaaabbabbbabaabbbabbbaaabaabaaaabaa
+abababaaaaaaaaaaabbbaababaaaabbabbaabbabbabaabaaaabaabaababaabbabaabbbbb
+ababbbaaabaabbaaabaababaabbbbbaa
+abbabbbaababbababbbbbabaaabaabbabaabbabbbbaaaabaabaaabaa
+ababbaabababbbabbbbbaaab
+babbabaababaaabbbaabaabb
+bbababbbaaabbaabbabbabaaaabaabaa
+abaababbbaabbababaaababbbabaababbaaaaabaabbabbbb
+ababababaaababaabbaaaabb
+bbbaaaaaababbaababaabbba
+babbbaababbbabbabbabaababaababbabbaababa
+baabaabbbbaaaaaabbbaaabb
+abbbaababbbbbabababbaabaaaaaabaaabbaaaaaabbbbaabaabbbbaaaabbbbabaababaab
+ababaabbaabababbbbabbaabaaababaabaaaaababaaaabba
+ababbbbbaabbaababababaababaaaaaaabbaaaaabbabbbaa
+abbaaabbabaaaabbbbbabbbbbabbaabbbbbaaaaaabbbabbbbbbaabba
+aaababbaaaaabaabbbaaababaaaabbbb
+aabaaababbbbbbabaaabbabaabbaaaaabbbbbbbbababababbbaababbbabbabab
+bbbaababbaaabbaabbbbbbaaabaaaaabaabbaababbaaaaab
+aaaabbbaababbaabbabaabbababaaabbbaabbaab
+bbbabababbababababbaabaa
+bbbbabaabbaababbaaaabbbaabbbbbab
+aaabbaaaaaaabbbaabbbbbbaabaaaabababbbaaabbaababbbaaaaaaaababbbbabababaaa
+aaaaabbababbababbbababbbbaaababbabaabbaaaababbaabbaabbaa
+bbabbabaaaaaabaabababbbbaaabbbba
+ababbbaabbababbaaaaaaaab
+babaaabbbaabbabaaaabaabb
+babbababbbbbabaabababaab
+bababbabbbaabaabbbbabaab
+abbbaabaaabbbbbbaabbbbbbaabaaabbbbbbbaaaababbaaaaababaaabaaabaaa
+abaabaaaabaababababaaabaaaabbbaabbabaaab
+ababbbabaaaaaaaababbbbab
+bbabbbbaabbbbabaaaaaabbbbababbaaabbbbbbbbbaabbbabbaaababababbbbbabbaabbabbabaaaabbbabbba
+abaaaabbaaabbaabaaabaaaabbbabbbbababbbaabaabbbab
+aabbbbbbbabbaababaabbababaabbbba
+baaaabbbbababbabbbaabbba
+abbbaaaaababbbababbabaaa
+bbbabbbaaaababbaabaabbaaabaababaabbabababbaaabbaaaaaaabbabaabbabbbbaabbb
diff --git a/19/input.small b/19/input.small
new file mode 100644
index 0000000..1500b6f
--- /dev/null
+++ b/19/input.small
@@ -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
diff --git a/19/src/main.rs b/19/src/main.rs
new file mode 100644
index 0000000..5bbdcc6
--- /dev/null
+++ b/19/src/main.rs
@@ -0,0 +1,127 @@
+use advent_lib::prelude::*;
+
+use std::collections::BTreeMap;
+//use std::convert::TryFrom;
+
+#[derive(Clone,Debug)]
+enum Rule {
+  Alternatives(Vec<Vec<i64>>),
+  Character(char),
+}
+
+
+fn main() -> Result<()> {
+  let mut args = std::env::args();
+  if args.len() != 2 {
+    eprintln!("Usage: advent input");
+  }
+  let _ = args.next();
+  let filename = args.next().unwrap();
+
+  let input = advent_lib::read_lines_file(&filename)?;
+  let input = advent_lib::group_lines_by_blanks(input);
+
+  let mut rules: BTreeMap<i64,Rule> = BTreeMap::new();
+  for line in &input[0] {
+    let colon_point = line.find(':').unwrap();
+    let (rule_number, rest) = line.split_at(colon_point);
+    let rule_number = rule_number.parse::<i64>().unwrap();
+    let (_, rest) = rest.split_at(2);
+    let words: Vec<&str> = rest.split(' ').collect();
+
+    let mut chars = words[0].chars();
+    if words.len() == 1 && chars.next() == Some('"') {
+      let c = chars.next().unwrap();
+
+      rules.insert(rule_number, Rule::Character(c));
+    } else {
+      let alternatives_inputs = words.split(|word| *word == "|");
+
+      let mut alternatives: Vec<Vec<i64>> = Vec::new();
+      for alternative_words in alternatives_inputs {
+        let mut alternative: Vec<i64> = Vec::new();
+        for word in alternative_words {
+          alternative.push(word.parse::<i64>().unwrap());
+        }
+        alternatives.push(alternative);
+      }
+
+      rules.insert(rule_number, Rule::Alternatives(alternatives));
+    }
+  }
+
+  let mut match_count = 0;
+  for line in &input[1] {
+    if is_match(&rules, 0, line) {
+      match_count += 1;
+    }
+  }
+
+  println!("{:?}", match_count);
+
+  rules.insert(8, Rule::Alternatives(vec![vec![42], vec![42, 8]]));
+  rules.insert(11, Rule::Alternatives(vec![vec![42, 31], vec![42, 11, 31]]));
+
+  let mut match_count = 0;
+  for line in &input[1] {
+    if is_match(&rules, 0, line) {
+      match_count += 1;
+    }
+  }
+
+  println!("{:?}", match_count);
+
+  Ok(())
+}
+
+
+fn is_match(rules: &BTreeMap<i64,Rule>, root_rule: i64, input: &str) -> bool {
+  let match_results = is_match_helper(rules, root_rule, input);
+  for rest in match_results {
+    if rest.len() == 0 {
+      return true;
+    }
+  }
+  false
+}
+
+fn is_match_helper<'a>(rules: &BTreeMap<i64,Rule>, root_rule: i64, input: &'a str)
+  -> Vec<&'a str>
+{
+  let mut results = Vec::new();
+
+  match rules.get(&root_rule).unwrap() {
+    Rule::Alternatives(alternatives) => {
+      for alternative in alternatives {
+        let mut possible_rests = Vec::new();
+        possible_rests.push(input);
+
+        for sub_rule in alternative {
+          let mut new_possible_rests = Vec::new();
+
+          for rest in possible_rests {
+            let sub_matches = is_match_helper(rules, *sub_rule, rest);
+            for new_rest in sub_matches {
+              new_possible_rests.push(new_rest);
+            }
+          }
+
+          possible_rests = new_possible_rests;
+        }
+
+        for rest in possible_rests {
+          results.push(rest);
+        }
+      }
+    },
+    Rule::Character(character) => {
+      if input.len() >= 1 && input.chars().next() == Some(*character) {
+        let (_, rest) = input.split_at(1);
+        results.push(rest);
+      }
+    },
+  }
+
+  results
+}
+
diff --git a/19/tests/main.rs b/19/tests/main.rs
new file mode 100644
index 0000000..394fb0f
--- /dev/null
+++ b/19/tests/main.rs
@@ -0,0 +1,14 @@
+use assert_cmd::prelude::*;
+use std::process::Command;
+
+
+#[test]
+fn personal_input() -> Result<(), Box<dyn std::error::Error>> {
+  let mut command = Command::cargo_bin("advent_17")?;
+
+  command.arg("input");
+  command.assert().success().stdout("265\n1936\n");
+
+  Ok(())
+}
+