Compare commits
No commits in common. "8877dff48a3cdf73ede2e70c4db1f97ea7ebc6d6" and "1a4f2da0ce10a7e5728fdfbe1df21404bf7833c8" have entirely different histories.
8877dff48a
...
1a4f2da0ce
142
day07/input
142
day07/input
@ -1,142 +0,0 @@
|
||||
......................................................................S......................................................................
|
||||
.............................................................................................................................................
|
||||
......................................................................^......................................................................
|
||||
.............................................................................................................................................
|
||||
.....................................................................^.^.....................................................................
|
||||
.............................................................................................................................................
|
||||
....................................................................^...^....................................................................
|
||||
.............................................................................................................................................
|
||||
...................................................................^.^...^...................................................................
|
||||
.............................................................................................................................................
|
||||
..................................................................^.....^.^..................................................................
|
||||
.............................................................................................................................................
|
||||
.................................................................^.^.^.^.^.^.................................................................
|
||||
.............................................................................................................................................
|
||||
................................................................^.^.^...^.^.^................................................................
|
||||
.............................................................................................................................................
|
||||
...............................................................^.^.^.^.^.^.^.^...............................................................
|
||||
.............................................................................................................................................
|
||||
..............................................................^.^.^.^.^.....^.^..............................................................
|
||||
.............................................................................................................................................
|
||||
.............................................................^.^.^.^.^.^.^.^.^.^.............................................................
|
||||
.............................................................................................................................................
|
||||
............................................................^.^.....^.^.^.^.^.^.^............................................................
|
||||
.............................................................................................................................................
|
||||
...........................................................^...^.^...^.^.^...^.^.^...........................................................
|
||||
.............................................................................................................................................
|
||||
..........................................................^.^.^.^.^.^...^.^.^...^.^..........................................................
|
||||
.............................................................................................................................................
|
||||
.........................................................^...^.....^.^...^.^.^.^.^.^.........................................................
|
||||
.............................................................................................................................................
|
||||
........................................................^.^...^.^...^.^.^.^.^.^...^.^........................................................
|
||||
.............................................................................................................................................
|
||||
.......................................................^...^.^...^.^...^.^...^.....^.^.......................................................
|
||||
.............................................................................................................................................
|
||||
......................................................^...^...^.^...^.^.^.^.^.^.^.^...^......................................................
|
||||
.............................................................................................................................................
|
||||
.....................................................^.^.^.^.^.^.^...^.^.^.^...^.^.^.^.^.....................................................
|
||||
.............................................................................................................................................
|
||||
....................................................^.^.^...^.^...^.^...^.^.^.^.^.^.^...^....................................................
|
||||
.............................................................................................................................................
|
||||
...................................................^.^.^.^.^.^.^...^.^.^.^.^.^.....^.^.^.^...................................................
|
||||
.............................................................................................................................................
|
||||
..................................................^.^...^.^.^.....^...^...^.^...^.^...^...^..................................................
|
||||
.............................................................................................................................................
|
||||
.................................................^.......^.^.^.....^.^.^.^.^.^.^.^...^...^.^.................................................
|
||||
.............................................................................................................................................
|
||||
................................................^...^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^................................................
|
||||
.............................................................................................................................................
|
||||
...............................................^.^.....^.^.^.^...^.^.^.^.^...^...^...^.^.....^...............................................
|
||||
.............................................................................................................................................
|
||||
..............................................^...^...^.^.^...^...^.....^.^.......^.....^.....^..............................................
|
||||
.............................................................................................................................................
|
||||
.............................................^.^.^.....^.^.....^.^.....^.......^.^.^.^.^.^.^.^.^.............................................
|
||||
.............................................................................................................................................
|
||||
............................................^.^.....^.^.^.........^.^...^.^...^...^.^.^.^...^...^............................................
|
||||
.............................................................................................................................................
|
||||
...........................................^.^.....^.......^.^.^...^.^.^.^.^.^.^.....^...^.^...^.^...........................................
|
||||
.............................................................................................................................................
|
||||
..........................................^.^.....^.^.^.^...^.^...^.^.^.^.^.^.^.....^.^.^...^...^.^..........................................
|
||||
.............................................................................................................................................
|
||||
.........................................^.^.....^.^.......^.........^.^.^.^...^.^.^.^...^.^.....^.^.........................................
|
||||
.............................................................................................................................................
|
||||
........................................^.^.^.^...^...^...^.^.^.^.^.^.^.^.^.^...^.....^.^.^.^.^.^...^........................................
|
||||
.............................................................................................................................................
|
||||
.......................................^.....^.^.^.......^.^...^.....^.^.^...^...^.^.^.^.^.^.^.^.^...^.......................................
|
||||
.............................................................................................................................................
|
||||
......................................^.^.....^...^.^.^.^.^...^.^.^.....^.^.....^.^.^.^.^...^.^.^.^...^......................................
|
||||
.............................................................................................................................................
|
||||
.....................................^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^...^.^.........^.^.^.....................................
|
||||
.............................................................................................................................................
|
||||
....................................^.^.^.^.^.^.^.^.^.....^.^.^...^...^...^.^.....^.^.^...^.^...^...^.^.^....................................
|
||||
.............................................................................................................................................
|
||||
...................................^.^.....^.^.^...^...^.^...^...^.......^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^...................................
|
||||
.............................................................................................................................................
|
||||
..................................^.^.^.^.^.^.^.^.^.^...^.^...^...^.^.^.^.^.^.^.^.....^.^.^...^.....^.^...^..................................
|
||||
.............................................................................................................................................
|
||||
.................................^.^.^.^.......^...^.^.^...^.^.^.....^.^...^.^.^.^...^.^.^.^...^.^.^.^...^.^.................................
|
||||
.............................................................................................................................................
|
||||
................................^.^.^.........^.^...^.^...^.^.^.^.^...^.^...^.^.....^...^.^.^...^...^.^...^.^................................
|
||||
.............................................................................................................................................
|
||||
...............................^.....^.^.....^.^.^.^.....^.^.^.^.^.^.^.^.^.....^.....^.^...^.....^.^.^.^.^.^.^...............................
|
||||
.............................................................................................................................................
|
||||
..............................^.^.^.^.^.^.....^.^.^.^.^.....^.^.^.^.^.^.....^...^.^...^.^.^.^.^.^.^...^.^.^...^..............................
|
||||
.............................................................................................................................................
|
||||
.............................^...^...^.^.^.^...^.^.......^.^...^...^.^...^.^.^.^...^...^.^.^.....^.^.^...^.^.^.^.............................
|
||||
.............................................................................................................................................
|
||||
............................^...^.^...^.^.^.^...^.^...^...........^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^...^.....^.^.^............................
|
||||
.............................................................................................................................................
|
||||
...........................^.^...^.^.^...^.^.^.^.^.^.^.^.....^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^.^.^.^.^.^.^.^...........................
|
||||
.............................................................................................................................................
|
||||
..........................^.^.^...^.^...^.^.^...^...^.^.^.^.^...^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^...^.^.^.....^.^.^..........................
|
||||
.............................................................................................................................................
|
||||
.........................^...^...^.^.^.^.^...^...^.......^.^...^.^...^.^.^...^.^.^.^...^.^.^.^...^.^...^.^...^.^.^.^.........................
|
||||
.............................................................................................................................................
|
||||
........................^.^.^.^.^.^.^...^...^.^.^...^.^.^.^.^.^...^...^...^.^.^.....^.^...^.^...^.^.^.^.^.......^.^.^........................
|
||||
.............................................................................................................................................
|
||||
.......................^.^.^.^.^.^.^.^.........^.^.^.^...^.^...^...^.^.^.^.^...^.^...^.^.^...^...^.^.^.^...^.^.^.^...^.......................
|
||||
.............................................................................................................................................
|
||||
......................^.^.^.^.......^.^.^.^.^...^...^...^.^.^...^.....^.^.^...........^.^.^.^.^...^.^.^.^.^.^.^...^.^.^......................
|
||||
.............................................................................................................................................
|
||||
.....................^.^.^...^...^...^.........^...^.^...^.^.^...^.^.^.^...^.^.^...^.^...^...^...^...^.^.^.....^.^.^...^.....................
|
||||
.............................................................................................................................................
|
||||
....................^.^.^.....^.^.^...^...^.^.^.^.^.^.^.^.^.^.^.....^...........^...^.^.^.^.^.^.^...^.....^.^...^...^.^.^....................
|
||||
.............................................................................................................................................
|
||||
...................^.....^.....^.......^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^.^.......^...^.^.^...^.^.^.^.^.^.^.^.^.....^.^...^...................
|
||||
.............................................................................................................................................
|
||||
..................^.^.^...^.^.^.^.^...^.^.^...^.^.^.^.^.^.^.^.^...^.^.^.^.^...^...^...^.^.^.^.^...^.^...^...^.^.^...^...^.^..................
|
||||
.............................................................................................................................................
|
||||
.................^.^.^.^.^.^...^.^.^.^.^.^...^.^.^.^.^...^.......^...^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^.^.^...^...^.^.^.................
|
||||
.............................................................................................................................................
|
||||
................^...^.^.^.^.^...^...^.^...^...^.^.^...^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^...^...^.^.^.^.^.....^.^.^.^.^.^................
|
||||
.............................................................................................................................................
|
||||
...............^.....^.^.^.^.^.......^.^.^...^.^.^.^.^.^...^.^.^.^.^.....^.^.^.....^.^.^.^...^.....^.^.^...^.^...^.^.^.^.^...^...............
|
||||
.............................................................................................................................................
|
||||
..............^.^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^...^.^...^.^.......^.^.^.^.....^...^.........^.....^...^.^.^.^.^...^.^.^.^.^..............
|
||||
.............................................................................................................................................
|
||||
.............^.^.^...^.....^.....^...^.^...^.^...^.^.^.^.^.^.^.^...^.^.^...^.^...^.....^.^.^.^.^.^...^.^...^.^...^.^.^.^.^.....^.............
|
||||
.............................................................................................................................................
|
||||
............^.^.^...^.^.^.^.^.^.^...^.^...^...^.^.^.^.^.^...^...^.^.^.^...^.^.^.^.....^.....^.^...^...^...^.^.^.^.^.^.......^.^.^............
|
||||
.............................................................................................................................................
|
||||
...........^...^.^...^.^.^.^.^.^...^.^.^.^.^.^.^.^.^.^.^.^...........^.^...^.^...^...^.^.^.^.^.^...^.....^.......^.^.^.^...^...^.^...........
|
||||
.............................................................................................................................................
|
||||
..........^.^.^.^...^...^...^.^.^.....^.^...^.^.^.^...^.^...^.^.^.^...^.^.....^.^...^.^.^.^...^.^.^.^.^...^...^.^.^.^.^.^...^.^.^.^..........
|
||||
.............................................................................................................................................
|
||||
.........^.....^...^.^...^.^.^.^.^.^.^...^.^...^.^.^.^.^...^...^.......^.^...^.^.^.^.^.^.^.....^...^.....^.^.^.^.^.^.^.^.^...^.^.^.^.........
|
||||
.............................................................................................................................................
|
||||
........^.^.^.^.^...^...^.^.^...^.^.^.^...^.^.^.^...^.^...^.^.^.^.....^.^.^.^.....^.^.^.....^.^.^.^...^.^...^.....^.^.^.^.^.^...^.^.^........
|
||||
.............................................................................................................................................
|
||||
.......^.^.......^.....^.^.^.^...^.^.^.^.^...^.....^.^.^.^.^.^.^.^.^.^...^.....^...^.^...^.^.^.^...^.^.^.......^.^...^.........^.^.^.^.......
|
||||
.............................................................................................................................................
|
||||
......^.^...^.....^.^.^.^...^.^.^.^.^.^...^.......^.....^.^.....^.^.^...^.^.^.^...^.^.^.^.^...^.^.^.^.^...^.^.^.^.....^.....^.^.^.^.^.^......
|
||||
.............................................................................................................................................
|
||||
.....^.^.^.^.....^...^.^.^.^.^.....^...^.^...^.^.^.^...^.^.^.....^.^...^...^.^.^.^.....^.^.......^...^...^.^.......^.....^.^...^.^.^.^.^.....
|
||||
.............................................................................................................................................
|
||||
....^.^.....^.^.^.^...^.^.....^.....^.^.^.^.^.^.^.^.^.^.....^.^.^.^.^...^.^.^.^...^.^.^.^.^.^...^...^...^.^.^...^.....^...^...^...^.....^....
|
||||
.............................................................................................................................................
|
||||
...^...^.^.^.^.^...^...^.^.^.^.^...^.^.^...^.^.^.^...^...^.^.^.^...^...^...^...^.^.^.^.^.........^.....^...^.^...^.........^.^.^...^...^.^...
|
||||
.............................................................................................................................................
|
||||
..^.^.....^.^.^.......^...^.^.^...^.^.....^.^...^.^...^.....^.^.....^.^.^...^...^.^.^...^.^.....^.....^...^...^.^.^...^.^.^.^.^...^.^.^.^.^..
|
||||
.............................................................................................................................................
|
||||
.^.^.^.^.^.^.^...^.^...^.^...^.^.....^.....^.^.^.^.^.^.^.^.^...^.^...^...^.....^.^.^.^.^...^.^.^.^...^.^.^.^.^.^.......^.^...^.^.^.^.^...^.^.
|
||||
.............................................................................................................................................
|
||||
16
day07/sample
16
day07/sample
@ -1,16 +0,0 @@
|
||||
.......S.......
|
||||
...............
|
||||
.......^.......
|
||||
...............
|
||||
......^.^......
|
||||
...............
|
||||
.....^.^.^.....
|
||||
...............
|
||||
....^.^...^....
|
||||
...............
|
||||
...^.^...^.^...
|
||||
...............
|
||||
..^...^.....^..
|
||||
...............
|
||||
.^.^.^.^.^...^.
|
||||
...............
|
||||
30
day07/sol.py
30
day07/sol.py
@ -1,30 +0,0 @@
|
||||
from collections import Counter
|
||||
def solve(input):
|
||||
splits = 0
|
||||
pos = []
|
||||
paths = Counter()
|
||||
for row in open(input):
|
||||
row = row.strip()
|
||||
paths.clear()
|
||||
for i,count in pos:
|
||||
if row[i] == '.':
|
||||
paths[i] += count
|
||||
elif row[i] == '^':
|
||||
if i-1 >= 0:
|
||||
paths[i-1] += count
|
||||
if i+1 < len(row):
|
||||
paths[i+1] += count
|
||||
splits += 1
|
||||
start = row.find('S')
|
||||
if start >= 0:
|
||||
paths[start] += 1
|
||||
|
||||
pos = sorted(paths.items())
|
||||
|
||||
# part 1
|
||||
print(splits)
|
||||
# part 2
|
||||
print(sum(paths.values()))
|
||||
|
||||
solve("sample")
|
||||
solve("input")
|
||||
Loading…
x
Reference in New Issue
Block a user