Advertisement
icarussiano

day 13 part 1

Dec 15th, 2023
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. l=[x.splitlines() for x in open("input").read().split("\n\n")]
  2. def refl(p):
  3.     for i in range(1, len(p)):
  4.         if all(x==y for x,y in zip(p[:i][::-1],p[i:])):
  5.             return i
  6.     return 0
  7.  
  8. print(sum(refl(x)*100+refl(list(zip(*x))) for x in l))
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement