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PHHHHAAAAAAAAAAAAAAAAUUUUUUUUUUUUUUUUKKKKKKKKKCCCCCCCCCCCCPPPPPPPPPPPPPPPPPPPPPPUUUUUUUUUUUUUUSSSSSSSSSSSSOQQQQQQQQQQQQQHHLLUULL +PPPPPPPPPPPPPPHQHAAAAAAAAAAAAAAATTTUUUUUUUUUUUUUUKKKKKKKKKKCCCCCMMCPPPPPPPPPPPPPPPPPPPPPPPPPUUUUUUUUYUUUUUUSSSSSSSSSSSQQQQQQQQQQQKKQHHLUUUUU diff --git a/day12/sample4.in b/day12/sample4.in new file mode 100644 index 0000000..85b768f --- /dev/null +++ b/day12/sample4.in @@ -0,0 +1,10 @@ +RRRRIICCFF +RRRRIICCCF +VVRRRCCFFF +VVRCCCJFFF +VVVVCJJCFE +VVIVCCJJEE +VVIIICJJEE +MIIIIIJJEE +MIIISIJEEE +MMMISSJEEE diff --git a/day12/sol.py b/day12/sol.py new file mode 100644 index 0000000..e509adb --- /dev/null +++ b/day12/sol.py @@ -0,0 +1,45 @@ +import itertools +def solve(file): + grid = [l.strip() for l in file] + ny = len(grid) + nx = len(grid[0]) + def get(p): + x,y = p + if 0 <= x < nx and 0 <= y < ny: + return grid[y][x] + return '.' + + def flood(initial_point): + c = get(initial_point) + stack = [initial_point] + count = {} # set of points connected to x,y. value is the number of connected neighboring points + while stack: + p = stack.pop() + if p not in count: + count[p] = 0 + x,y = p + for n in (x+1,y), (x-1,y), (x,y+1), (x,y-1): + if get(n) == c: + stack.append(n) + count[p] += 1 + return count + + points = lambda: itertools.product(range(nx), range(ny)) + + done = set() # set of points which have been counted as part of a shape + total = 0 + for p in points(): + if p in done: continue + shape = flood(p) + done |= shape.keys() + area = len(shape) + perim = 0 + for p,n in shape.items(): + perim += 4-n + #print(get(p), area, perim) + total += area * perim + + print(total) + +solve(open("sample4.in")) +solve(open("input"))