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 starter.py and utils.py

+7
+1
2018/starter.py
··· 25 25 26 26 for i, line in enumerate(fileinput.input()): 27 27 line = line.strip() 28 + nums = parse_nums(line) 28 29 data = parse_line(r'', line) 29 30 30 31 if i == 0:
+6
2018/utils.py
··· 179 179 def __hash__(self): 180 180 return hash(tuple((self.x, self.y))) 181 181 182 + def to(self, other): 183 + return math.sqrt((self.x - other.x) ** 2 + (self.y - other.y) ** 2) 184 + 185 + def to_manhattan(self, other): 186 + return abs(self.x - other.x) + abs(self.y - other.y) 187 + 182 188 @property 183 189 def manhattan(self): 184 190 return abs(self.x) + abs(self.y)