Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- points = []
- with open("day9_input.txt") as f:
- line = f.readline()
- while line:
- points.append(tuple([int(n) for n in line.split(',')]))
- line = f.readline()
- def area(c1, c2):
- x1, y1 = c1
- x2, y2 = c2
- return (abs(x1-x2)+1)*(abs(y1-y2)+1)
- largest = 0
- for i, c1 in enumerate(points):
- for c2 in points[i+1:]:
- largest = max(largest, area(c1,c2))
- print(largest)
Advertisement
Add Comment
Please, Sign In to add comment