My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update 2018/05 solution

+1 -3
+1 -3
2018/day05.py
··· 9 9 poly = poly.replace('', '') 10 10 11 11 while True: 12 - improved = False 13 12 for (x, X) in zip(ascii_lowercase, ascii_uppercase): 14 13 new = poly.replace(x + X, '').replace(X + x, '') 15 14 if len(new) < len(poly): 16 15 improved = True 17 16 poly = new 18 17 break 19 - 20 - if not improved: 18 + else: 21 19 return len(poly) 22 20 23 21