From c4c0314906aacc828714a4823d2a591a41e75760 Mon Sep 17 00:00:00 2001 From: kamoshi <18511281+kamoshi@users.noreply.github.com> Date: Sat, 19 Dec 2020 16:52:26 +0100 Subject: [PATCH] Update day19.py --- 2020/Python/day19.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2020/Python/day19.py b/2020/Python/day19.py index b06bfe2..c3b64be 100644 --- a/2020/Python/day19.py +++ b/2020/Python/day19.py @@ -65,7 +65,7 @@ def solve_p2(rules, strings) -> int: return out[:-1] + ")" elif rule_idx == 8: return out + convert_to_regex2(42) + "+)" - elif rule_idx == 11: # I'm not proud of this at all, but it worked + elif rule_idx == 11: # I'm not proud of this at all, but it worked (in fact I hate it) return out + convert_to_regex2(42) + f"({convert_to_regex2(42)}({convert_to_regex2(42)}({convert_to_regex2(42)}{convert_to_regex2(31)})?{convert_to_regex2(31)})?{convert_to_regex2(31)})?" + convert_to_regex2(31) + ")" pattern_str = convert_to_regex2(0) + "$"