add AOC 2023
This commit is contained in:
parent
d966812945
commit
3cff0fc5cf
12 changed files with 1717 additions and 0 deletions
7
2023/day1/example.txt
Normal file
7
2023/day1/example.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
two1nine
|
||||||
|
eightwothree
|
||||||
|
abcone2threexyz
|
||||||
|
xtwone3four
|
||||||
|
4nineeightseven2
|
||||||
|
zoneight234
|
||||||
|
7pqrstsixteen
|
1000
2023/day1/input.txt
Normal file
1000
2023/day1/input.txt
Normal file
File diff suppressed because it is too large
Load diff
57
2023/day1/main.py
Executable file
57
2023/day1/main.py
Executable file
|
@ -0,0 +1,57 @@
|
||||||
|
#!//usr/bin/env python
|
||||||
|
|
||||||
|
|
||||||
|
def get_lines():
|
||||||
|
lines = list()
|
||||||
|
with open("input.txt", "r") as f:
|
||||||
|
for line in f:
|
||||||
|
lines.append(line.strip())
|
||||||
|
return lines
|
||||||
|
|
||||||
|
|
||||||
|
total = 0
|
||||||
|
|
||||||
|
for line in get_lines():
|
||||||
|
for char in line:
|
||||||
|
if char.isdigit():
|
||||||
|
first = int(char)
|
||||||
|
break
|
||||||
|
for char in line[::-1]:
|
||||||
|
if char.isdigit():
|
||||||
|
last = int(char)
|
||||||
|
break
|
||||||
|
|
||||||
|
value = first * 10 + last
|
||||||
|
total += value
|
||||||
|
|
||||||
|
print(total)
|
||||||
|
|
||||||
|
total = 0
|
||||||
|
for line in get_lines():
|
||||||
|
digits = []
|
||||||
|
for i in range(len(line)):
|
||||||
|
rest = line[i:]
|
||||||
|
if rest.startswith("one"):
|
||||||
|
digits.append(1)
|
||||||
|
if rest.startswith("two"):
|
||||||
|
digits.append(2)
|
||||||
|
if rest.startswith("three"):
|
||||||
|
digits.append(3)
|
||||||
|
if rest.startswith("four"):
|
||||||
|
digits.append(4)
|
||||||
|
if rest.startswith("five"):
|
||||||
|
digits.append(5)
|
||||||
|
if rest.startswith("six"):
|
||||||
|
digits.append(6)
|
||||||
|
if rest.startswith("seven"):
|
||||||
|
digits.append(7)
|
||||||
|
if rest.startswith("eight"):
|
||||||
|
digits.append(8)
|
||||||
|
if rest.startswith("nine"):
|
||||||
|
digits.append(9)
|
||||||
|
if rest.startswith("zero"):
|
||||||
|
digits.append(0)
|
||||||
|
if rest[0].isdigit():
|
||||||
|
digits.append(int(rest[0]))
|
||||||
|
total += digits[0] * 10 + digits[-1]
|
||||||
|
print(total)
|
5
2023/day2/example.txt
Normal file
5
2023/day2/example.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
|
||||||
|
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
|
||||||
|
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
||||||
|
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
||||||
|
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
|
100
2023/day2/input.txt
Normal file
100
2023/day2/input.txt
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
Game 1: 4 red, 1 green, 15 blue; 6 green, 2 red, 10 blue; 7 blue, 6 green, 4 red; 12 blue, 10 green, 3 red
|
||||||
|
Game 2: 3 green, 18 blue; 14 green, 4 red, 2 blue; 3 red, 14 green, 15 blue
|
||||||
|
Game 3: 12 green, 2 blue; 9 green; 1 red, 11 blue, 4 green
|
||||||
|
Game 4: 4 blue, 8 green, 5 red; 6 red, 7 blue, 9 green; 2 green, 2 red, 2 blue; 2 green, 6 blue, 9 red; 10 red, 9 green
|
||||||
|
Game 5: 12 red, 1 green, 7 blue; 13 red, 16 blue; 16 blue, 10 red; 4 blue; 16 blue, 7 red; 1 blue, 7 red
|
||||||
|
Game 6: 17 blue, 2 red; 5 blue, 6 green, 2 red; 5 green, 5 blue; 5 green, 12 blue, 4 red
|
||||||
|
Game 7: 2 red, 1 blue, 10 green; 8 red, 14 green, 9 blue; 15 red, 1 blue, 6 green; 9 blue, 3 green, 10 red; 7 blue, 13 red, 4 green
|
||||||
|
Game 8: 1 green, 2 blue; 7 red, 2 blue, 1 green; 1 red, 2 green; 4 red, 1 blue; 11 red, 2 green, 2 blue; 1 blue, 2 green, 11 red
|
||||||
|
Game 9: 11 green, 11 blue, 6 red; 2 green, 3 blue, 2 red; 2 red, 11 blue, 14 green; 5 green, 7 red, 7 blue; 7 green, 1 red, 12 blue; 1 red, 8 green, 7 blue
|
||||||
|
Game 10: 2 red, 8 green, 7 blue; 10 red, 5 green, 2 blue; 4 red, 8 green, 16 blue; 10 blue, 3 green, 15 red
|
||||||
|
Game 11: 2 blue, 2 green, 5 red; 1 green, 3 red, 3 blue; 11 green, 1 red, 2 blue
|
||||||
|
Game 12: 8 blue, 11 green, 14 red; 10 green, 13 red, 2 blue; 1 red, 6 green, 4 blue; 13 red, 11 green, 6 blue
|
||||||
|
Game 13: 15 red, 17 green, 1 blue; 12 red, 1 blue, 1 green; 2 red, 1 blue, 14 green
|
||||||
|
Game 14: 6 green, 11 red, 3 blue; 6 green, 2 blue; 2 green, 10 red, 8 blue; 2 red; 1 green, 9 red; 3 blue, 1 green, 3 red
|
||||||
|
Game 15: 11 blue, 11 green, 4 red; 3 green, 10 blue; 2 red, 9 green, 9 blue
|
||||||
|
Game 16: 2 blue, 11 green; 1 red, 1 blue, 11 green; 12 green, 1 blue, 1 red; 3 blue, 14 green, 1 red; 14 green, 4 blue; 2 blue, 12 green
|
||||||
|
Game 17: 1 red, 2 blue, 4 green; 4 blue, 3 green; 1 green, 1 red, 6 blue; 1 red, 7 blue; 2 green
|
||||||
|
Game 18: 3 red, 3 blue, 7 green; 2 blue, 2 red, 2 green; 4 red, 12 green; 5 green, 2 blue, 4 red; 3 red
|
||||||
|
Game 19: 15 red, 7 blue, 10 green; 5 green, 8 red; 9 green, 8 red; 5 red, 10 green
|
||||||
|
Game 20: 15 blue, 6 green, 11 red; 13 red, 9 blue, 1 green; 15 blue, 10 red, 11 green
|
||||||
|
Game 21: 15 red, 4 green; 11 red, 2 blue, 4 green; 5 blue, 2 green, 4 red; 4 red, 5 blue; 6 red, 3 blue, 1 green
|
||||||
|
Game 22: 4 green, 4 red, 13 blue; 3 red, 7 blue, 9 green; 12 blue, 13 green, 5 red
|
||||||
|
Game 23: 20 green, 4 red; 6 blue, 9 red, 7 green; 6 green
|
||||||
|
Game 24: 1 green, 3 blue, 6 red; 1 green, 1 blue, 2 red; 3 blue, 5 red, 1 green
|
||||||
|
Game 25: 2 red, 9 blue, 2 green; 2 green, 1 red, 5 blue; 3 red, 1 green, 3 blue; 8 blue, 2 green, 3 red; 12 blue, 3 red; 1 blue, 2 green, 1 red
|
||||||
|
Game 26: 2 blue, 5 green, 20 red; 2 blue, 6 red, 9 green; 3 red, 2 blue, 5 green
|
||||||
|
Game 27: 17 blue, 2 red, 14 green; 15 green, 16 blue, 2 red; 13 blue, 13 green; 1 red, 7 green, 3 blue; 1 blue, 2 green
|
||||||
|
Game 28: 5 blue, 6 red, 3 green; 7 red, 19 green; 11 blue, 13 green
|
||||||
|
Game 29: 1 blue, 8 red, 7 green; 1 green, 1 red; 8 red, 7 green, 1 blue; 7 green, 2 red; 1 blue, 7 red; 1 blue, 2 red, 5 green
|
||||||
|
Game 30: 3 red, 17 blue; 11 red, 3 blue, 8 green; 7 green, 12 blue, 10 red; 5 blue, 2 green
|
||||||
|
Game 31: 14 blue, 7 green; 12 green, 14 blue, 2 red; 17 blue, 2 red, 8 green; 2 red, 3 blue, 11 green; 9 green, 4 blue; 1 red, 3 green, 1 blue
|
||||||
|
Game 32: 15 red, 1 blue, 10 green; 15 green, 10 red, 1 blue; 2 red, 6 green, 1 blue
|
||||||
|
Game 33: 10 green, 1 red, 16 blue; 11 blue, 14 green, 3 red; 14 green, 13 blue; 17 blue, 2 red, 3 green
|
||||||
|
Game 34: 8 red, 7 blue, 8 green; 3 green, 1 red; 1 red, 1 green, 5 blue; 6 red, 8 green, 2 blue; 7 red, 8 blue, 3 green
|
||||||
|
Game 35: 5 blue, 19 red; 2 blue, 11 red, 1 green; 16 red, 10 blue; 7 green, 3 blue, 6 red; 3 green, 18 red, 5 blue; 8 blue, 5 red
|
||||||
|
Game 36: 9 red, 6 green, 10 blue; 9 red, 15 green, 6 blue; 6 red, 1 blue, 14 green
|
||||||
|
Game 37: 7 green, 8 red, 2 blue; 3 blue, 5 red, 16 green; 1 green, 1 red, 3 blue
|
||||||
|
Game 38: 5 green, 5 red, 3 blue; 10 blue, 19 red, 9 green; 2 red, 3 blue, 11 green
|
||||||
|
Game 39: 15 red, 11 blue, 5 green; 11 green, 2 red, 6 blue; 2 blue, 3 green, 6 red; 15 red, 3 blue, 13 green
|
||||||
|
Game 40: 7 green, 4 red, 1 blue; 6 blue, 6 green, 2 red; 2 blue, 3 red, 1 green; 1 blue, 3 red, 3 green; 2 red, 5 green, 3 blue
|
||||||
|
Game 41: 10 blue, 8 green, 9 red; 7 blue, 9 red, 2 green; 10 blue, 4 red, 5 green
|
||||||
|
Game 42: 8 blue, 13 green, 14 red; 8 blue, 1 green, 11 red; 4 red, 6 green, 3 blue; 14 green, 4 red, 2 blue
|
||||||
|
Game 43: 2 red, 10 green, 19 blue; 5 blue, 4 green, 9 red; 9 green, 9 red, 2 blue
|
||||||
|
Game 44: 6 red, 2 green, 3 blue; 2 blue, 12 red, 6 green; 1 red, 10 blue; 12 red, 6 green, 2 blue; 14 red, 13 green, 3 blue; 10 green, 9 blue, 11 red
|
||||||
|
Game 45: 2 blue, 1 red, 1 green; 1 green, 1 blue; 2 green, 2 blue
|
||||||
|
Game 46: 7 green, 1 red; 1 green, 4 blue, 1 red; 3 blue, 4 green, 1 red; 1 red, 4 green; 1 blue, 12 green, 1 red; 16 green, 1 blue
|
||||||
|
Game 47: 4 blue, 8 green, 3 red; 6 red, 1 green, 3 blue; 16 green, 4 blue, 1 red; 4 blue, 8 red
|
||||||
|
Game 48: 1 blue, 9 red, 8 green; 8 green, 2 blue, 6 red; 2 green; 4 blue, 5 red; 1 blue, 9 red, 9 green; 1 red, 1 blue, 3 green
|
||||||
|
Game 49: 3 green, 2 blue; 7 blue, 4 red; 20 green, 5 red, 13 blue; 20 green, 1 red, 6 blue
|
||||||
|
Game 50: 3 red, 3 green; 3 green, 3 red; 2 blue, 10 red; 3 blue, 5 green; 14 red, 2 green, 2 blue; 7 red, 2 green
|
||||||
|
Game 51: 3 green, 3 blue, 2 red; 4 green, 16 red, 3 blue; 1 blue, 3 red; 9 red, 1 blue, 4 green
|
||||||
|
Game 52: 6 red, 18 green, 7 blue; 2 blue, 1 red, 5 green; 8 blue, 6 red, 1 green; 1 red, 1 blue; 6 red, 3 green, 10 blue
|
||||||
|
Game 53: 1 blue, 10 red, 3 green; 13 red, 2 green, 1 blue; 1 green, 2 red
|
||||||
|
Game 54: 4 blue, 6 green, 2 red; 5 blue, 6 red, 2 green; 6 blue, 4 green, 8 red; 13 red, 10 blue, 1 green; 5 red, 5 green, 9 blue
|
||||||
|
Game 55: 4 green, 18 red, 4 blue; 9 blue, 7 green, 16 red; 5 red, 6 blue, 14 green; 13 green, 11 red, 9 blue; 6 blue, 13 green, 1 red; 10 blue, 12 red, 14 green
|
||||||
|
Game 56: 8 green, 5 blue, 10 red; 10 green, 7 red, 12 blue; 11 red, 12 blue, 1 green; 4 blue, 6 red, 10 green; 17 blue, 8 green, 2 red
|
||||||
|
Game 57: 1 green, 2 red; 2 green, 5 red, 1 blue; 13 red, 3 green, 4 blue; 3 blue, 13 red, 9 green
|
||||||
|
Game 58: 1 red, 7 blue, 4 green; 2 green, 1 blue, 1 red; 1 green, 11 blue; 12 blue; 1 blue, 5 green, 1 red; 3 green, 11 blue, 1 red
|
||||||
|
Game 59: 5 green, 3 blue, 17 red; 2 red, 9 green; 1 blue, 4 green
|
||||||
|
Game 60: 5 red, 5 green, 1 blue; 2 red, 2 blue, 6 green; 2 red, 3 blue, 3 green
|
||||||
|
Game 61: 2 green, 3 blue, 4 red; 17 green, 1 blue; 1 green, 6 red, 4 blue; 3 blue, 9 green, 3 red; 18 green, 7 red, 2 blue
|
||||||
|
Game 62: 5 red; 3 blue, 9 green; 3 red, 13 blue, 10 green; 14 green, 1 red, 2 blue; 7 blue, 13 green
|
||||||
|
Game 63: 12 blue, 5 green; 5 green, 1 red, 1 blue; 4 red, 7 green, 9 blue; 8 blue, 2 green, 7 red
|
||||||
|
Game 64: 3 blue, 11 green; 5 blue, 2 red, 5 green; 17 green, 5 blue, 1 red; 4 red, 3 blue, 4 green
|
||||||
|
Game 65: 2 red, 1 blue, 2 green; 7 green, 2 red, 1 blue; 2 blue, 7 green, 1 red; 3 blue, 8 green, 3 red
|
||||||
|
Game 66: 4 red, 12 blue, 1 green; 20 blue, 3 green, 2 red; 11 blue, 1 green
|
||||||
|
Game 67: 12 blue, 10 red, 13 green; 19 green, 4 red, 7 blue; 12 red, 9 blue, 13 green
|
||||||
|
Game 68: 2 blue, 17 green; 12 green, 2 red; 5 red, 2 green, 4 blue; 4 blue
|
||||||
|
Game 69: 17 blue, 3 red, 1 green; 4 green, 8 blue, 8 red; 4 green, 7 red, 1 blue; 8 red, 1 green, 11 blue; 13 blue, 10 red, 9 green; 14 blue, 5 green, 6 red
|
||||||
|
Game 70: 1 red, 2 blue, 4 green; 13 blue, 3 red, 2 green; 6 green, 8 blue
|
||||||
|
Game 71: 5 red, 7 green, 1 blue; 11 green, 4 red, 1 blue; 1 red, 12 green, 10 blue; 1 red, 7 blue, 12 green
|
||||||
|
Game 72: 9 blue, 4 green, 1 red; 6 green, 4 blue; 8 green, 5 blue, 1 red
|
||||||
|
Game 73: 1 blue, 10 green, 14 red; 4 green; 2 blue, 9 red, 4 green; 2 blue, 13 green; 13 green, 13 red; 7 red, 5 green, 2 blue
|
||||||
|
Game 74: 3 red, 1 blue, 3 green; 4 green, 1 blue, 1 red; 2 blue, 10 green, 1 red; 1 blue, 3 red, 1 green
|
||||||
|
Game 75: 1 red, 1 blue, 1 green; 2 red, 1 green, 4 blue; 2 red, 4 blue; 1 blue, 1 red
|
||||||
|
Game 76: 4 green, 2 blue, 6 red; 7 green, 1 red; 8 green, 4 red
|
||||||
|
Game 77: 8 green, 7 blue, 5 red; 6 red, 14 green, 7 blue; 8 green, 7 blue; 1 red, 8 green, 8 blue
|
||||||
|
Game 78: 6 red, 3 blue, 3 green; 7 blue, 10 red; 5 green, 10 blue, 1 red; 3 green, 11 blue, 4 red; 14 red, 9 blue, 2 green; 16 red, 2 green, 12 blue
|
||||||
|
Game 79: 1 green; 5 green; 11 green, 3 blue, 2 red; 3 blue
|
||||||
|
Game 80: 2 green, 2 red; 1 blue, 1 green, 1 red; 1 blue, 1 green, 2 red; 2 red; 5 green
|
||||||
|
Game 81: 10 blue, 2 red, 9 green; 4 red, 12 blue, 5 green; 7 green, 4 blue, 6 red; 1 red, 13 green, 14 blue; 13 green, 11 blue
|
||||||
|
Game 82: 4 blue, 2 green; 7 blue, 3 green, 5 red; 1 red, 4 blue, 3 green; 5 blue, 1 red, 6 green; 6 green, 4 red; 11 blue, 3 red, 5 green
|
||||||
|
Game 83: 12 green; 5 red, 8 green; 11 red, 14 green, 1 blue; 9 green, 4 red
|
||||||
|
Game 84: 5 blue, 1 red; 16 blue, 5 green; 1 red, 9 blue, 3 green; 11 blue; 1 green, 2 blue; 1 red, 7 blue, 4 green
|
||||||
|
Game 85: 17 red, 5 blue; 18 blue, 2 red, 2 green; 18 blue, 2 green, 8 red
|
||||||
|
Game 86: 4 red, 1 blue, 11 green; 6 blue, 7 green, 1 red; 3 green, 4 blue; 2 red, 7 blue, 2 green
|
||||||
|
Game 87: 4 red, 5 blue; 1 green, 15 red, 1 blue; 11 blue, 12 red
|
||||||
|
Game 88: 11 green, 3 red, 1 blue; 6 green, 1 blue, 1 red; 1 blue, 3 green; 2 blue, 4 green, 2 red
|
||||||
|
Game 89: 2 green; 1 red, 2 green, 3 blue; 4 blue, 1 red, 10 green; 4 blue, 5 green; 6 blue, 1 red, 10 green
|
||||||
|
Game 90: 15 red, 7 green, 17 blue; 7 blue, 1 red; 7 green, 6 red, 3 blue
|
||||||
|
Game 91: 2 blue, 17 red, 6 green; 1 green, 1 blue, 6 red; 6 red, 4 blue; 10 green, 14 red, 1 blue; 7 blue, 10 green, 10 red; 16 red, 11 green, 9 blue
|
||||||
|
Game 92: 1 green, 8 blue, 4 red; 4 green, 4 red, 4 blue; 1 green, 7 red, 4 blue
|
||||||
|
Game 93: 11 blue, 12 red, 1 green; 9 blue, 2 green, 5 red; 7 red, 5 blue, 2 green
|
||||||
|
Game 94: 7 blue, 10 green; 9 green, 9 blue, 2 red; 1 red, 5 green, 4 blue
|
||||||
|
Game 95: 1 green, 1 blue, 2 red; 6 red; 1 blue; 1 green, 1 blue, 6 red
|
||||||
|
Game 96: 1 blue, 1 red, 2 green; 4 red, 13 green, 1 blue; 1 blue, 13 green, 5 red; 7 green, 4 red
|
||||||
|
Game 97: 10 blue, 5 red, 5 green; 4 red, 8 green, 2 blue; 5 red, 2 green, 15 blue; 2 red, 1 green, 4 blue; 2 red, 14 blue; 14 blue, 4 green
|
||||||
|
Game 98: 11 red, 8 green, 9 blue; 3 blue, 1 green, 14 red; 10 blue, 2 red, 4 green; 7 blue, 11 red, 3 green; 5 red, 12 blue, 4 green; 7 green, 7 blue, 8 red
|
||||||
|
Game 99: 3 green, 2 blue, 1 red; 15 red, 8 blue, 7 green; 18 red, 12 blue, 2 green
|
||||||
|
Game 100: 11 red, 1 blue, 2 green; 3 red, 3 green; 1 blue, 8 red, 4 green; 5 green, 5 blue, 1 red; 2 green, 1 red, 6 blue; 2 green, 8 red, 1 blue
|
53
2023/day2/main.py
Normal file
53
2023/day2/main.py
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
import math
|
||||||
|
|
||||||
|
games = dict()
|
||||||
|
|
||||||
|
with open("input.txt", "r") as f:
|
||||||
|
for line in f:
|
||||||
|
game = list()
|
||||||
|
x, y = line.strip().split(":")
|
||||||
|
game_number = int(x.split(" ")[1])
|
||||||
|
sets = y.strip().split(";")
|
||||||
|
for s in sets:
|
||||||
|
ss = {}
|
||||||
|
grabs = s.split(", ")
|
||||||
|
for grab in grabs:
|
||||||
|
cube_count, colour = grab.strip().split(" ")
|
||||||
|
ss[colour] = int(cube_count)
|
||||||
|
game.append(ss)
|
||||||
|
games[game_number] = game
|
||||||
|
|
||||||
|
print(games)
|
||||||
|
|
||||||
|
query = {"red": 12, "green": 13, "blue": 14}
|
||||||
|
|
||||||
|
possible_games = []
|
||||||
|
for id, game in games.items():
|
||||||
|
possible = True
|
||||||
|
for s in game:
|
||||||
|
for colour, count in s.items():
|
||||||
|
max = query[colour]
|
||||||
|
if count > max:
|
||||||
|
possible = False
|
||||||
|
if possible:
|
||||||
|
possible_games.append(id)
|
||||||
|
|
||||||
|
part1 = 0
|
||||||
|
for id in possible_games:
|
||||||
|
part1 += id
|
||||||
|
print("part1", part1)
|
||||||
|
|
||||||
|
part2 = 0
|
||||||
|
for id, game in games.items():
|
||||||
|
min = {"red": 0, "green": 0, "blue": 0}
|
||||||
|
|
||||||
|
for s in game:
|
||||||
|
for colour, count in s.items():
|
||||||
|
if count > min[colour]:
|
||||||
|
min[colour] = count
|
||||||
|
|
||||||
|
print(min)
|
||||||
|
power = min["red"] * min["green"] * min["blue"]
|
||||||
|
print(power)
|
||||||
|
part2 += power
|
||||||
|
print(part2)
|
10
2023/day3/example.txt
Normal file
10
2023/day3/example.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
467..114..
|
||||||
|
...*......
|
||||||
|
..35..633.
|
||||||
|
......#...
|
||||||
|
617*......
|
||||||
|
.....+.58.
|
||||||
|
..592.....
|
||||||
|
......755.
|
||||||
|
...$.*....
|
||||||
|
.664.598..
|
140
2023/day3/input.txt
Normal file
140
2023/day3/input.txt
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
.........798...145.........629....579.....455.....................130.............243.................154........167........................
|
||||||
|
............*.....*...........*...&...179.*........737...194.........*854........./...........52..560*............................699...&...
|
||||||
|
........459..489.817........880.........*..996........*....*........................................................................*.36....
|
||||||
|
...........@.........................813............234.552..307....184............370..................736.....960..............631........
|
||||||
|
...100...................*...............131..................*........=......435..*......34...........*....................................
|
||||||
|
......+....#126.......214..........$......*.....+.............939................/..729..............861.....243..........438...............
|
||||||
|
...................................854....979....177.......%.........280..138................158*241............*..........*....*904...#....
|
||||||
|
.......427............................................683&.726...303........*.......905.......................&..115.....412.479.....491....
|
||||||
|
.....=.*...........989......888.....................$............../.226....922.172....*..702*693...........543.............................
|
||||||
|
..924..219...........*.....*........979............191.%.........+..............*.....323....................................777............
|
||||||
|
....................109........................559.....835.....708........989..685................................#.............=.915.......
|
||||||
|
........................................*........=.........751........886................243.......154+..922...347................/.........
|
||||||
|
......923...............571.....@.672....963.471.......154...*.........*.....................914...........*.............891.........73*212.
|
||||||
|
.........*......654+....&....309...=.........*....543.........583....871.....*........................551...370...$......*...492............
|
||||||
|
..618*....60.........................426...&.645....*....................203..310....$...........@166...........477...@.......%......150*...
|
||||||
|
......353......381..........416.....*....19......536......#..312..../790.*............779..$.........../............985..................761
|
||||||
|
...........#............636..*....238...................576.....*........899................460.841..829.415...271*.......168.77....=.......
|
||||||
|
..........427............$.......................................75..............789...942........-......*.........795......*.......73......
|
||||||
|
....863................%.......920..........*152.....852*387.........990.....563..*.....*...629........772....912............283............
|
||||||
|
837*.......897.......674...966....&.%621..77..................................&..571...272.........566.....16*.....936.....&......980.......
|
||||||
|
..............*............*....-.........................*..............424#...................53.*......................203...............
|
||||||
|
...826.781.....105......&...771.982............967......40.223.....................71............*..123.........-...@....................998
|
||||||
|
...$................64.562.............../382....*.................866-....276.....*........750.975...........878..156..........188.........
|
||||||
|
...........38+..............937...................142.........*712........$.....619..*734............424..................=.................
|
||||||
|
....746...................@....+..868..-......881...........................+.........................*.......832.../....649...-.......181..
|
||||||
|
...*.......+637...478....628......%.....651....................../.....399%..396.............&..293.472..........*.960..........988....*....
|
||||||
|
....693..........$..................-.......711.99.489.878....541...........................565..#.........32..710......499............888..
|
||||||
|
....................681.59.442.....368.%.........*.......&..........................974............*........%...............................
|
||||||
|
677....924......797.......*............964......666.................89......309.......*.........324.179..........437.......235.321...678....
|
||||||
|
............+..........$......5...............$......./......23..............$.........328..564.........392......*............*........*....
|
||||||
|
...298......811.........976..*.................400...140....*.......893................................*....%.682.....345.............726...
|
||||||
|
..............................570.839......................828.....*......-......59....373.......%...558..271...........*......*751.........
|
||||||
|
.....570...........353*674........#....636........659..............647.....226..*.......+......684...............139...290..401........290..
|
||||||
|
........&..................231...............80..........@112....................892......605...............247...+................$...*....
|
||||||
|
165........*329..94*254..........115...............938.................192...............*......$58.............@......786.....328..59..285.
|
||||||
|
.........98........................$.....895......*...............459..*...............399..641..................285...$..........*.........
|
||||||
|
.............../..455*429............794*.....................512.*....770.....448...........@...................................336.175....
|
||||||
|
......#......277................................763............*..254.....................*....143...495..$.......676...................#...
|
||||||
|
.......272.........-..................711..911...*.....614..516............747.389.....803........%.....*.832.......*....905....576..#......
|
||||||
|
625.................595......989...............291.....*................*.....*............$..201.............528.722....%.....*......896...
|
||||||
|
....342............................................569..486.......@..278.184.........259..107................%.................749..........
|
||||||
|
...#..................851.......16..436*910.......@..............338...........989...*..........+.367.867............=..918.................
|
||||||
|
.................106..#.........@...........................@.....................-...99......38....%....*.18&....550..*..........250.......
|
||||||
|
..................+.........................&732....53....258....850..................................306.............539....@..............
|
||||||
|
658*869..............684*636....422.686............*...............*...955..............*......................../...........313.....$......
|
||||||
|
.............604.............................954....357.........458..................168.310.......698............435......%......394.......
|
||||||
|
.....109....*.........163...........962$.....@..........=..................876*........................230..125...........24..972.....641...
|
||||||
|
......*...312..........#........................*914....740....466*............374.............+......%....*...........46....*.....60.......
|
||||||
|
...422............804......$.@......%........589...................500..958.............21..301...........889............*..717.............
|
||||||
|
..........474..=.....*...302.475.155.............665..800..46..............=...................................19......902........936...887.
|
||||||
|
............*.754...831...............8@.@............................110.....554..........732...=913.........*.....$............*..........
|
||||||
|
456......211.................562.........183........................@......+..*.....839...............@...500.739..962.....105...528..-.....
|
||||||
|
...............794.882.......+.....@..........833............595....704.693......=...*..............81...*.............571*............727..
|
||||||
|
......590.30......*.................872...@...................................773.....156......&346......807.813.285+.........380...........
|
||||||
|
........$..*...........*621.....528.....835.....556.......*85...516-.......................28.........*......-..........791$.....%..........
|
||||||
|
....................965.....507.*.............*....*...377.............957................@....835.707.409.....987*...........=.......729...
|
||||||
|
.....503......471..........*....267..169....200.369..........499..#...*....................................161.....464.....794.....*...#....
|
||||||
|
........$.......*..........808......*....&..........643.....*....39....354......159........117@...308....-...*.........144.........452......
|
||||||
|
..........$......910...........195..952..320.........*......832.................*...296.............*..860..401.........%....157/...........
|
||||||
|
.......438..721................@..............89..144..332........987.........979..*.....%.........824............709................710....
|
||||||
|
...209.......-........../............=952..............*.............*292.........582.661.....$........815.............857....254....*......
|
||||||
|
....&..218%..........100................................74....................*................692.-.......545...................*..........
|
||||||
|
.............297..........101....276.756..............#....462......492*578..636......=............860..........................399.........
|
||||||
|
........171..............=........#..*...............407...%.......................331..915..............................919................
|
||||||
|
....454*...................*83......100..702..............................271...........@...........59....582.../........*...........+......
|
||||||
|
..............185*......687...........................186............739-...=......*.................+....*.....380..539..192.80......455...
|
||||||
|
.......174........686.........562...958......192.......*..117...108.............567.298.................545...........*...........$.........
|
||||||
|
.....$.....887........131..........-....955...*.....504...........%.243..281........................877.............610......216..130...-...
|
||||||
|
.....646....*......76....................%..50.......................*.......541.......782.....752+....*......296*.......523...@......881...
|
||||||
|
............802....*........976.................223*478........96...785.142.*......530....*721.........577........317.......*.....295.......
|
||||||
|
....412.114........561...#....+............................52....*......*....999......*./....................................221.....*40....
|
||||||
|
......*./......*.........435..........168..779....-..........*.272.....372.........652...489........*988.......810..........................
|
||||||
|
80.110.......137....938...........924....#.+...896........305....................................885...........................831..........
|
||||||
|
........&...............792.........................................773*100.958..&78.....*..............902....286................+.........
|
||||||
|
........873..............&...........585..................127*899..............*.......60.982...........$......@....268..370.............567
|
||||||
|
............781...*...........*174...*...............................26........203.652................................*............538......
|
||||||
|
.............$.....534.....848......170......418........494/....298...*....792......./.......%......+687..............179............@.160..
|
||||||
|
..474...711....................417.................................@.458....$..........*338..719............509..488......781.982...........
|
||||||
|
.....*..........235.................622............$...804+..............*......577.870.............&..43.....&..-.............*.....278....
|
||||||
|
....696.222.604.*.......*29...........$.....&....755...........55.....631.202.....................443....*....................692...*.......
|
||||||
|
...........*....55...456.....782..422.......133......844........*..........................286-...........865.89..27...718........317.......
|
||||||
|
.......611.....................-...*..995........712..*..........89...............@166..............771............*.....*..............589.
|
||||||
|
...........417.....150..678...........*.............$.417..298.............611&..........811.327......*..$...610%.614.....443......-...*....
|
||||||
|
.......658*..........-...*.......622..940.............................&....................*../..773.194.479..........996.........263..872..
|
||||||
|
....90......%550.587......215.......*.......322.....229......841*....996...........826....305......@.........#405.....$.....................
|
||||||
|
......*...........*..................671....*......*.............695.......694....+..............................................223.462.826
|
||||||
|
..419.832.......271...828................228.................380........21*..........644............725....703......255..330........*.......
|
||||||
|
.....................*.............................357.................................*........360...+.....#..%173...*..../../.............
|
||||||
|
..................182...........88.664*......865..*................................428.................................143...829.552.....829
|
||||||
|
...&..................425..894...*.....792...*.....321..219................=...564....*..166....%....+.....764...................*......=...
|
||||||
|
..619.....529..384.....*......*...693.........188......-............281.238......=.339....*...124...278.....+....490.....481....416.........
|
||||||
|
.................*.442..76....801.....376.................+511.......*......*.............967.......................*.68*............919....
|
||||||
|
...731..484....875..#....................*243...681.................135..191.162.688%.........29.....*............688..........437......*...
|
||||||
|
.....%.=........................329*87.............*138.-949..186.................................595.554...............755....*.....454....
|
||||||
|
............341..302.........&...........330.....................@.......................779..............353......@.......*..535...........
|
||||||
|
.....766.....*..*..........315......856.*................540..............136............*.......914..162*.......7..336..383............642.
|
||||||
|
......../..253...502................*...990.....299.......+...413............*..........338.......%.............................294*........
|
||||||
|
.....&..................636.986.431.345...............693.......*.......*...............................276..........836@.278.......716..469
|
||||||
|
.....247........*.905*....$..*...*.......................$.....502...177.........72=......$...232......*................................*...
|
||||||
|
.........674.905......664...124............*127.............................564........924.....*.....&.616...661..403....10.........429.724.
|
||||||
|
........../..............................78..............#5..................*................498..650..........*.......*............*......
|
||||||
|
.....348....*.........488...........414..........................962...552...107...@...533......................109....432....*......423....
|
||||||
|
....*.......536................283....&......800.............&.......+..../........677.$..................32...............410.392..........
|
||||||
|
....826.............755........*........396..*......../.......771.....837........=.............577.................53...............314.....
|
||||||
|
.........@....109$...*..........988........$..241..750.............@............169...162......*...%....575.743......*..................278.
|
||||||
|
..........862........227....585........158.............262.....51..151..................*..509...31............*..........+....144.481.&....
|
||||||
|
........*........467........*.........#..../..........*......................%....973..218..*..........@.......543......678.......*.........
|
||||||
|
......32.106...$...*......260...........425.........912.................383..392.*...........503....546..212........%......./442.....221....
|
||||||
|
..............668...593............422.......966*37................503..*.........776.....5$..............*......833.................&......
|
||||||
|
............-...................21....*.-497............................133...........862......241.............-..........824...............
|
||||||
|
.........215.......................851.........-........932........@./.......-.......-....%..................597..........*........@........
|
||||||
|
................*323....557....782..........964...14..$....$.....631.144.....588.........316......................252..396........257...957.
|
||||||
|
.............367........*......*.....64.97........=..976.....245................../982..........135...169........*.....................=....
|
||||||
|
....513..........96.101..359.212.585..............................965*287.803.501.........460.........*.........618....98.208...............
|
||||||
|
.............802*...+............#..............804..123...579*..............*.............*.......282.....263...........*..................
|
||||||
|
.707....522....................................*........@......106..143.........716......770...........576*......................497........
|
||||||
|
......#.../...=.........835............545*610.462..188............*.............*.....$...............................*115......*....*.....
|
||||||
|
928%.606.......207.......*......61..........................797.....228..357....484..492..........247...............574..........880.994....
|
||||||
|
...........541...........444......@....122......................505......+...14..........534........*.....210...........150.948..........210
|
||||||
|
..............*..676*765...............*.....295.156...601#....*......-.......*.....709..........901.....*........714......*............&...
|
||||||
|
.......723...299................325...965...........*.........656......156....824...../..............840.383...........249..........=.......
|
||||||
|
..................................#........26*781.456................#.....................745......*.............165.*..........278..452...
|
||||||
|
.746..............953.943.............................877.....59......128............#....+......585......641....%.....229...*2........*....
|
||||||
|
...*.......614=......*.......903.............433.370...=...54....+..............&.....336.....$.............*..........................856..
|
||||||
|
698...272.....................%......545.....-....$.............223.183..........339........189............994.......531.815*206............
|
||||||
|
........./................657...........#...............571............=..-832.+....................876..............................754....
|
||||||
|
.....&.....*960....628.............597.............747$.*......776..+..........709..................*..........266..........225.....*.......
|
||||||
|
...541..511.............353.......*......................649.....*..753...719......212..526=...578..634..........*..........*......113......
|
||||||
|
................996=...*...........18........#628..............321........*.......*...........*...................194....334.............126
|
||||||
|
......................627..693.........248..........290.................@..204..=..247...574..311......791....................679*..........
|
||||||
|
.......@....................=......283*............*.............38..214........90.........*.......447...+.............77...%.....265.......
|
||||||
|
......566......&.................*..........965...929...........*......................869.908.753..$.......437....848*.....943.............
|
||||||
|
...........403.950..............439............*............340.419...........868.....*...........*...128.....&.....................869.....
|
||||||
|
............*..........637...............256.793........436*....................*.....85.361.....280..................349...................
|
||||||
|
.........654...........*..............=.-........949............=....224..506.631....................*21.@...........%......................
|
||||||
|
.............#..44.......105.108...190..........*....$173......750....*...../.........37.......-..461.....727...75.......................893
|
||||||
|
......@...583.....*........*................358...........750........................*......532..................*...22...../....512...#....
|
||||||
|
863...112................178...+...........*...........5./............98......584..222..........862...235.....448...*.....737.....*.....516.
|
||||||
|
....#.......425..............923.84*......947......999*..............*....280*...........732...&.....*.............14.............683.......
|
||||||
|
.....353............................914........105.................829...........112...............75.......................................
|
79
2023/day3/main.py
Normal file
79
2023/day3/main.py
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
matrix = []
|
||||||
|
|
||||||
|
with open("input.txt", "r") as f:
|
||||||
|
for line in f:
|
||||||
|
matrix.append(line.strip())
|
||||||
|
|
||||||
|
number_extends = []
|
||||||
|
|
||||||
|
for rowi, row in enumerate(matrix):
|
||||||
|
number_extends.append([])
|
||||||
|
last_chari = -1
|
||||||
|
for chari, char in enumerate(row):
|
||||||
|
if chari <= last_chari:
|
||||||
|
continue
|
||||||
|
if char.isnumeric():
|
||||||
|
first_chari = chari
|
||||||
|
last_chari = chari
|
||||||
|
charit = chari + 1
|
||||||
|
while charit < len(row):
|
||||||
|
if row[charit].isnumeric():
|
||||||
|
last_chari = charit
|
||||||
|
charit += 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
number_extends[rowi].append((first_chari, last_chari))
|
||||||
|
|
||||||
|
numbers = []
|
||||||
|
|
||||||
|
gears = {}
|
||||||
|
|
||||||
|
for rowi, number_extend_row in enumerate(number_extends):
|
||||||
|
for start, end in number_extend_row:
|
||||||
|
number = int(matrix[rowi][start : (end + 1)])
|
||||||
|
|
||||||
|
def symbol_in_range(rowii, s, e):
|
||||||
|
if rowii < 0 or rowii >= len(matrix):
|
||||||
|
return False
|
||||||
|
e += 1
|
||||||
|
if s < 0:
|
||||||
|
s = 0
|
||||||
|
if e >= len(matrix[rowii]):
|
||||||
|
e = len(matrix[rowii]) - 1
|
||||||
|
for i in range(s, e):
|
||||||
|
char = matrix[rowii][i]
|
||||||
|
if char == "*":
|
||||||
|
# Found a gear
|
||||||
|
if (rowii, i) in gears:
|
||||||
|
gears[(rowii, i)].append(number)
|
||||||
|
else:
|
||||||
|
gears[(rowii, i)] = [number]
|
||||||
|
if (not char.isnumeric()) and (char != "."):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
if (
|
||||||
|
symbol_in_range(rowi - 1, start - 1, end + 1)
|
||||||
|
or symbol_in_range(rowi, start - 1, end + 1)
|
||||||
|
or symbol_in_range(rowi + 1, start - 1, end + 1)
|
||||||
|
):
|
||||||
|
numbers.append(number)
|
||||||
|
|
||||||
|
part1 = 0
|
||||||
|
for n in numbers:
|
||||||
|
part1 += n
|
||||||
|
|
||||||
|
print("part1", part1)
|
||||||
|
|
||||||
|
gear_ratios = []
|
||||||
|
|
||||||
|
for (row, col), gear_numbers in gears.items():
|
||||||
|
if len(gear_numbers) == 2:
|
||||||
|
gear_ratios.append(gear_numbers[0] * gear_numbers[1])
|
||||||
|
|
||||||
|
part2 = 0
|
||||||
|
|
||||||
|
for n in gear_ratios:
|
||||||
|
part2 += n
|
||||||
|
|
||||||
|
print("part2", part2)
|
6
2023/day4/example.txt
Normal file
6
2023/day4/example.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
|
||||||
|
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
|
||||||
|
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
|
||||||
|
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
||||||
|
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
||||||
|
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11
|
213
2023/day4/input.txt
Normal file
213
2023/day4/input.txt
Normal file
|
@ -0,0 +1,213 @@
|
||||||
|
Card 1: 69 61 27 58 89 52 81 94 40 51 | 43 40 52 90 37 97 89 80 69 42 51 70 94 58 10 73 21 29 61 63 57 79 81 27 35
|
||||||
|
Card 2: 5 75 37 76 98 32 24 83 44 50 | 80 75 91 5 33 52 31 96 83 92 46 98 55 65 48 24 44 4 32 60 88 37 76 50 77
|
||||||
|
Card 3: 37 39 43 53 47 20 50 56 78 65 | 80 56 32 78 72 97 40 77 17 50 87 99 36 93 63 19 39 59 44 52 23 75 9 51 43
|
||||||
|
Card 4: 6 25 31 60 2 50 89 67 82 16 | 65 89 5 67 68 53 50 6 51 25 96 32 2 16 41 60 63 90 82 30 98 31 75 14 7
|
||||||
|
Card 5: 43 39 98 45 33 87 36 23 61 66 | 93 61 4 21 47 32 94 99 45 23 87 64 92 43 33 5 83 16 98 44 39 77 66 18 36
|
||||||
|
Card 6: 59 6 65 20 62 3 92 79 98 24 | 80 15 28 70 24 32 93 99 91 86 95 16 90 83 11 75 19 4 48 6 78 61 20 27 7
|
||||||
|
Card 7: 49 54 25 44 79 68 13 60 1 43 | 16 18 4 82 99 23 80 46 79 55 14 1 32 13 54 84 37 44 20 68 25 60 27 49 43
|
||||||
|
Card 8: 52 50 19 69 28 93 32 98 97 47 | 2 40 28 47 20 60 66 98 12 19 31 14 16 75 97 49 93 69 11 52 50 87 24 32 27
|
||||||
|
Card 9: 47 44 94 43 75 49 77 24 93 45 | 94 47 30 43 24 77 44 31 66 75 45 54 92 49 84 53 20 11 17 16 86 93 50 85 76
|
||||||
|
Card 10: 23 39 92 16 68 30 49 59 34 90 | 85 15 25 31 92 90 47 59 11 36 68 10 96 65 16 49 18 97 9 83 28 61 4 94 46
|
||||||
|
Card 11: 21 37 14 89 46 31 64 90 43 45 | 63 29 14 23 7 28 13 86 83 16 19 24 78 54 47 51 58 77 71 40 56 62 20 89 39
|
||||||
|
Card 12: 69 98 97 19 70 5 62 25 55 90 | 1 35 45 25 75 61 50 99 82 96 71 74 72 76 3 70 14 57 88 27 5 94 58 32 85
|
||||||
|
Card 13: 24 51 65 64 29 37 86 60 41 94 | 40 13 88 85 46 59 90 55 8 72 56 93 6 71 52 87 31 91 20 5 83 36 86 43 96
|
||||||
|
Card 14: 43 76 64 80 49 48 83 14 51 54 | 1 99 54 36 80 48 49 15 43 17 51 96 83 40 76 14 41 75 84 55 63 91 64 58 9
|
||||||
|
Card 15: 9 33 75 53 48 76 25 83 28 24 | 1 10 69 28 76 87 71 52 26 44 66 92 75 55 7 40 93 20 12 91 30 33 46 39 31
|
||||||
|
Card 16: 55 92 85 21 81 90 47 63 34 70 | 26 2 1 87 59 69 40 58 46 43 70 17 35 71 6 63 49 13 81 11 85 94 44 96 5
|
||||||
|
Card 17: 21 42 95 24 35 53 39 14 18 4 | 76 23 5 79 22 20 36 69 38 77 40 37 32 89 49 15 59 44 51 25 74 34 54 16 28
|
||||||
|
Card 18: 63 21 61 65 82 69 27 74 98 58 | 51 58 86 21 90 54 45 41 71 74 83 6 42 1 35 78 31 9 55 46 11 15 63 84 82
|
||||||
|
Card 19: 44 41 24 51 74 20 97 31 83 39 | 17 24 2 54 73 28 13 55 49 79 42 62 58 8 95 23 86 70 76 41 26 4 80 25 11
|
||||||
|
Card 20: 83 61 55 56 96 16 95 49 65 90 | 67 75 63 37 87 54 39 19 99 81 47 49 24 84 41 13 78 40 38 64 26 34 15 72 48
|
||||||
|
Card 21: 23 89 57 54 90 82 2 8 65 80 | 78 14 21 39 45 42 1 80 99 20 52 11 31 50 68 82 59 4 96 55 6 46 88 38 34
|
||||||
|
Card 22: 85 6 4 41 5 35 31 19 64 17 | 83 56 96 41 16 39 70 81 67 51 74 99 1 18 43 48 5 85 29 88 30 52 69 11 61
|
||||||
|
Card 23: 72 88 38 82 33 10 75 44 70 53 | 7 71 56 96 19 89 30 67 21 22 48 45 80 86 39 61 4 44 74 28 23 40 46 72 78
|
||||||
|
Card 24: 75 67 13 39 63 58 43 35 49 99 | 28 46 17 95 55 2 83 18 42 91 20 78 97 51 60 81 47 69 64 57 37 77 12 61 67
|
||||||
|
Card 25: 87 44 62 66 82 20 7 21 51 32 | 54 97 46 1 95 14 26 47 94 25 49 30 84 12 5 73 48 89 45 53 28 74 93 88 13
|
||||||
|
Card 26: 65 6 10 66 15 26 47 62 63 68 | 5 60 71 41 68 66 53 26 6 56 38 47 90 62 63 33 81 10 15 3 16 96 83 65 20
|
||||||
|
Card 27: 7 95 47 35 58 87 21 68 80 37 | 94 24 39 74 43 78 69 54 10 32 84 99 41 75 6 86 11 66 56 62 16 44 5 59 65
|
||||||
|
Card 28: 95 19 21 14 59 74 27 68 32 99 | 83 35 5 41 92 59 26 57 18 55 52 32 6 23 36 54 56 50 15 48 27 89 45 53 12
|
||||||
|
Card 29: 1 8 93 94 72 89 13 37 58 49 | 35 62 88 26 94 50 31 87 72 78 85 1 44 49 22 5 20 91 98 13 77 93 60 48 52
|
||||||
|
Card 30: 47 94 67 27 56 25 38 52 28 32 | 22 61 56 82 58 27 32 18 33 94 79 23 62 60 76 98 67 49 77 64 11 47 40 16 42
|
||||||
|
Card 31: 61 68 80 67 41 6 52 33 22 91 | 54 10 72 91 31 33 95 43 39 68 81 22 63 67 32 61 27 73 66 75 36 79 6 59 80
|
||||||
|
Card 32: 62 5 57 36 87 33 53 86 82 8 | 76 32 30 5 53 57 86 56 97 77 18 33 8 82 15 71 83 17 48 90 9 43 54 88 4
|
||||||
|
Card 33: 79 25 27 11 17 23 76 38 15 26 | 83 80 37 36 77 24 20 55 16 59 81 7 19 1 18 91 42 29 22 2 41 27 6 50 92
|
||||||
|
Card 34: 3 8 29 57 87 88 97 12 41 95 | 29 94 44 20 34 28 76 12 95 74 22 85 31 64 91 50 1 97 35 49 98 41 92 67 25
|
||||||
|
Card 35: 43 79 50 20 6 76 25 14 66 89 | 93 72 50 67 38 89 13 87 46 54 36 52 20 57 56 17 3 22 43 63 14 84 15 29 16
|
||||||
|
Card 36: 68 15 59 47 30 98 89 27 5 25 | 11 8 32 72 18 74 73 48 39 53 51 88 22 90 55 40 14 44 66 12 94 71 9 13 31
|
||||||
|
Card 37: 11 48 72 90 12 86 34 32 51 7 | 52 80 36 46 74 64 44 27 11 47 61 84 55 28 77 26 58 54 3 5 17 60 89 16 72
|
||||||
|
Card 38: 13 97 42 79 96 69 8 57 90 48 | 84 67 52 8 20 54 21 45 69 23 28 85 92 95 40 59 87 2 50 83 14 6 16 70 39
|
||||||
|
Card 39: 87 67 8 38 15 20 96 30 45 97 | 36 28 43 35 9 27 14 70 29 1 40 56 60 81 63 48 53 44 31 75 49 85 64 39 69
|
||||||
|
Card 40: 63 35 33 6 58 97 91 34 67 18 | 68 61 98 66 84 20 37 41 17 50 81 14 60 78 36 9 65 21 83 2 71 79 85 7 47
|
||||||
|
Card 41: 75 97 62 6 92 69 53 20 45 5 | 5 53 56 69 84 97 75 62 39 18 22 64 6 92 70 41 45 20 17 63 7 9 54 29 21
|
||||||
|
Card 42: 64 21 72 62 90 50 84 28 71 37 | 71 38 64 50 42 4 65 85 91 21 55 58 10 92 90 7 17 60 84 70 37 72 28 98 62
|
||||||
|
Card 43: 58 28 84 32 92 18 48 73 86 5 | 43 32 33 35 84 50 64 6 21 52 92 58 29 95 11 18 28 79 48 77 5 86 60 73 10
|
||||||
|
Card 44: 30 69 44 40 5 58 22 63 65 90 | 65 68 69 43 58 5 72 90 22 63 52 78 66 15 60 88 30 12 74 44 67 40 41 38 29
|
||||||
|
Card 45: 69 53 87 59 27 10 16 90 52 35 | 83 4 87 89 11 30 45 70 52 13 35 92 90 79 6 68 71 86 16 97 26 72 39 96 53
|
||||||
|
Card 46: 78 8 1 64 87 6 3 7 75 82 | 48 84 56 8 89 73 31 68 64 46 40 6 41 14 78 97 91 27 95 28 47 30 37 58 75
|
||||||
|
Card 47: 58 24 13 97 18 50 89 9 14 81 | 97 24 54 16 14 32 78 62 50 5 18 42 20 99 15 58 13 89 96 72 81 75 29 9 86
|
||||||
|
Card 48: 87 83 32 53 5 72 86 84 65 9 | 30 89 54 53 58 13 85 81 83 39 71 5 91 65 68 82 94 42 87 24 86 29 47 32 28
|
||||||
|
Card 49: 38 4 66 35 19 56 78 90 81 65 | 60 16 82 68 7 49 15 32 3 22 48 11 38 53 83 45 54 23 5 81 78 34 63 27 65
|
||||||
|
Card 50: 9 48 47 87 99 6 65 2 44 75 | 75 79 55 82 44 27 42 48 51 65 16 68 3 52 30 62 84 66 87 69 8 10 86 35 72
|
||||||
|
Card 51: 28 24 85 63 96 30 88 29 5 50 | 71 61 30 90 65 96 41 50 82 68 39 10 81 29 48 26 80 97 28 24 27 88 38 5 63
|
||||||
|
Card 52: 86 80 90 33 19 78 13 69 89 27 | 62 54 85 88 97 64 37 31 29 6 94 69 67 51 57 58 89 13 76 55 22 96 63 66 38
|
||||||
|
Card 53: 75 5 78 44 10 77 3 89 39 4 | 41 61 76 56 75 85 7 22 19 51 5 87 53 10 79 24 39 94 26 57 1 35 83 32 34
|
||||||
|
Card 54: 70 80 59 16 6 99 83 37 26 8 | 62 58 16 74 35 53 94 1 80 89 61 11 86 36 83 14 8 39 43 6 92 99 18 64 79
|
||||||
|
Card 55: 41 39 43 58 60 65 74 76 11 46 | 58 42 60 59 13 16 83 55 37 25 32 96 22 79 69 2 89 3 21 71 35 67 95 19 45
|
||||||
|
Card 56: 10 18 89 9 63 51 81 4 49 75 | 3 32 45 68 87 65 71 55 79 89 37 64 21 53 30 62 26 6 90 51 70 74 22 10 54
|
||||||
|
Card 57: 27 58 75 7 80 71 45 46 26 55 | 67 76 91 16 69 82 24 48 46 87 28 20 75 36 86 8 51 42 9 84 3 43 27 34 70
|
||||||
|
Card 58: 64 55 76 63 58 66 34 27 46 62 | 79 22 69 33 1 81 4 76 36 40 88 39 2 47 89 48 29 77 93 67 41 10 95 19 63
|
||||||
|
Card 59: 62 1 42 32 48 12 94 36 33 86 | 71 41 46 96 12 55 10 38 15 43 1 60 67 2 30 89 37 98 19 18 69 25 50 20 77
|
||||||
|
Card 60: 11 14 6 57 55 62 88 19 24 26 | 45 58 88 83 51 36 46 32 85 17 61 33 31 2 91 9 78 39 81 20 87 86 64 66 49
|
||||||
|
Card 61: 9 28 27 33 53 71 38 63 55 60 | 26 77 83 57 75 50 3 68 31 52 24 94 40 18 8 80 70 5 25 72 47 44 45 89 19
|
||||||
|
Card 62: 47 64 33 74 26 82 21 30 69 39 | 29 68 65 37 60 58 17 48 75 91 2 9 16 31 46 49 97 57 94 40 34 13 11 43 39
|
||||||
|
Card 63: 1 16 10 67 73 48 66 78 55 32 | 31 54 78 79 42 34 81 55 37 63 29 73 90 48 11 77 67 14 46 19 16 66 89 53 32
|
||||||
|
Card 64: 59 33 71 69 84 2 53 95 28 52 | 85 82 66 79 45 71 33 10 30 84 52 19 94 54 28 41 61 59 6 69 53 97 38 2 49
|
||||||
|
Card 65: 17 46 40 23 93 76 45 2 43 32 | 17 32 23 2 52 7 15 77 20 39 46 64 99 59 98 89 43 40 93 4 45 11 72 76 13
|
||||||
|
Card 66: 58 9 28 19 90 80 77 11 81 20 | 44 51 39 20 63 6 11 88 61 27 90 53 62 70 34 42 28 24 78 16 81 65 9 31 15
|
||||||
|
Card 67: 88 42 78 9 26 43 54 95 8 40 | 58 54 10 43 60 36 40 42 95 63 4 88 82 50 38 26 8 99 31 74 13 46 91 61 44
|
||||||
|
Card 68: 32 95 6 83 30 14 38 15 87 70 | 79 15 64 45 99 70 17 38 87 93 83 53 14 77 85 32 19 95 29 6 7 61 90 30 67
|
||||||
|
Card 69: 76 15 92 22 48 46 42 39 84 32 | 51 26 1 9 2 73 17 94 6 62 92 77 32 90 43 48 81 22 88 58 78 46 79 98 15
|
||||||
|
Card 70: 62 90 81 15 8 3 72 93 65 32 | 57 62 3 80 26 67 10 72 54 36 98 29 17 90 93 32 49 48 76 8 12 31 65 81 15
|
||||||
|
Card 71: 74 46 75 14 56 20 83 28 35 61 | 57 61 75 59 54 55 56 32 71 4 18 60 72 94 39 86 30 50 48 41 7 14 77 73 85
|
||||||
|
Card 72: 47 63 42 84 87 78 21 56 97 26 | 87 40 78 1 48 7 26 63 42 37 30 97 65 84 14 93 85 39 47 11 50 71 21 28 56
|
||||||
|
Card 73: 20 56 88 38 50 74 76 69 63 17 | 73 47 87 89 98 18 33 14 3 78 72 39 77 97 74 80 81 51 88 59 46 2 70 69 20
|
||||||
|
Card 74: 44 74 4 59 77 99 66 81 8 6 | 75 88 25 73 74 86 16 8 99 17 50 22 83 35 67 3 77 5 46 34 68 80 6 23 54
|
||||||
|
Card 75: 58 25 36 26 80 12 88 51 98 71 | 71 66 77 83 51 61 23 98 33 53 18 75 43 20 26 92 70 90 25 94 86 12 34 36 22
|
||||||
|
Card 76: 14 79 44 82 59 75 43 88 12 52 | 11 30 26 74 82 91 72 79 35 69 52 24 13 23 3 22 78 38 43 10 14 53 76 66 90
|
||||||
|
Card 77: 65 79 38 39 3 18 89 51 9 41 | 5 87 13 45 86 85 72 7 92 22 36 69 67 82 40 73 83 15 34 59 68 57 31 84 71
|
||||||
|
Card 78: 67 89 71 15 39 66 29 97 11 38 | 4 95 21 74 29 43 51 65 31 91 98 39 71 13 93 88 64 47 40 76 58 6 92 80 81
|
||||||
|
Card 79: 8 60 27 44 15 52 91 99 35 47 | 97 1 35 81 53 79 16 23 52 77 11 56 2 85 21 96 46 83 5 37 49 93 13 76 69
|
||||||
|
Card 80: 1 37 16 40 6 48 66 26 90 12 | 87 23 24 5 67 80 20 53 95 66 93 85 7 34 32 52 92 61 9 27 41 35 36 57 38
|
||||||
|
Card 81: 72 39 83 5 69 43 73 92 88 78 | 77 74 68 78 9 75 50 65 8 14 35 96 64 80 58 6 4 46 57 61 66 85 48 40 34
|
||||||
|
Card 82: 38 2 71 61 46 97 8 84 43 24 | 91 50 76 58 17 11 66 60 65 16 44 70 96 20 37 94 30 99 6 69 32 29 81 49 48
|
||||||
|
Card 83: 50 89 48 66 96 97 28 5 12 76 | 89 93 79 68 16 48 44 42 28 41 83 50 97 96 76 82 15 57 10 66 5 12 74 38 4
|
||||||
|
Card 84: 9 71 98 81 59 30 99 45 80 48 | 6 17 31 35 88 57 10 81 77 70 58 21 34 63 51 84 74 37 64 80 29 16 3 11 76
|
||||||
|
Card 85: 36 86 69 83 56 51 19 67 65 10 | 35 3 55 38 90 59 82 2 32 10 17 36 52 69 83 65 13 92 97 99 48 30 87 68 70
|
||||||
|
Card 86: 6 96 82 83 89 31 91 20 28 5 | 20 11 84 45 50 81 23 56 24 28 1 53 2 57 54 64 3 94 96 43 6 26 91 77 66
|
||||||
|
Card 87: 84 22 38 2 94 23 76 64 29 42 | 13 99 48 23 62 82 38 91 31 88 14 43 66 94 36 64 49 85 26 97 71 39 22 68 60
|
||||||
|
Card 88: 69 25 81 63 86 79 1 64 76 38 | 85 81 63 6 69 50 16 65 54 25 27 38 84 76 7 64 79 12 86 88 70 94 39 1 20
|
||||||
|
Card 89: 7 43 74 93 60 24 33 53 97 35 | 62 51 93 86 81 71 63 2 13 99 66 83 97 37 10 77 55 27 73 92 67 19 33 88 96
|
||||||
|
Card 90: 2 78 5 23 69 72 93 86 55 24 | 92 38 66 85 34 52 83 24 31 6 25 13 33 30 17 7 81 15 16 9 21 53 94 2 77
|
||||||
|
Card 91: 34 21 58 13 99 32 61 65 49 30 | 50 73 18 84 99 53 21 61 94 22 26 93 30 68 34 65 58 72 77 32 49 11 13 39 9
|
||||||
|
Card 92: 15 67 55 79 9 88 33 7 94 49 | 20 94 87 58 9 35 93 7 67 21 15 57 30 56 88 85 5 13 60 83 2 55 38 28 6
|
||||||
|
Card 93: 16 11 80 5 33 23 96 21 56 94 | 1 37 85 94 72 42 66 16 10 70 86 77 33 21 55 11 6 45 96 29 90 14 80 48 64
|
||||||
|
Card 94: 2 57 51 10 3 70 63 60 1 40 | 67 80 96 98 52 74 97 33 92 88 19 62 43 73 55 3 1 20 95 99 12 90 17 24 56
|
||||||
|
Card 95: 80 18 73 50 2 3 83 65 33 26 | 7 78 28 4 2 19 14 29 61 81 17 38 57 89 11 20 5 12 13 10 24 96 75 25 55
|
||||||
|
Card 96: 98 53 54 50 20 34 28 96 59 88 | 52 41 53 29 40 15 88 93 30 76 97 81 73 17 12 70 6 63 27 32 64 48 69 96 44
|
||||||
|
Card 97: 66 82 79 74 75 71 29 32 96 50 | 62 46 76 30 21 50 98 17 32 75 87 96 41 42 79 73 45 92 51 91 78 35 27 72 74
|
||||||
|
Card 98: 93 39 91 70 97 33 57 69 53 73 | 38 71 33 25 52 26 75 94 93 42 17 82 7 27 47 89 18 11 20 91 40 31 55 19 4
|
||||||
|
Card 99: 93 31 61 29 77 60 66 92 3 10 | 55 63 56 4 61 33 60 85 45 48 78 27 25 36 42 93 20 67 49 21 7 83 65 13 71
|
||||||
|
Card 100: 21 86 19 62 53 34 88 42 71 47 | 74 7 79 85 22 60 76 10 40 62 50 92 20 24 12 42 15 31 56 90 44 72 34 11 95
|
||||||
|
Card 101: 8 68 64 72 98 60 56 69 57 25 | 24 5 95 77 89 58 39 63 80 48 53 66 38 61 31 3 43 1 16 71 52 82 19 14 51
|
||||||
|
Card 102: 47 39 45 40 54 93 87 26 33 67 | 95 80 98 3 24 53 96 9 90 13 35 21 86 88 63 55 1 42 25 56 32 60 34 40 77
|
||||||
|
Card 103: 64 18 52 28 82 54 31 49 66 44 | 4 78 40 73 32 99 33 6 29 46 11 25 47 36 14 97 79 61 63 50 55 26 30 58 77
|
||||||
|
Card 104: 95 84 89 87 57 53 12 43 58 1 | 59 45 57 58 39 61 52 81 43 40 23 86 1 97 95 55 89 84 87 6 17 85 53 12 28
|
||||||
|
Card 105: 98 81 56 52 37 26 46 39 88 36 | 4 34 88 32 5 73 98 26 39 77 93 42 62 82 41 81 56 1 12 33 46 36 14 52 37
|
||||||
|
Card 106: 97 98 42 95 14 87 41 46 44 27 | 5 82 46 66 87 41 51 55 13 27 7 44 31 97 77 10 14 90 98 94 95 12 79 42 35
|
||||||
|
Card 107: 15 30 60 32 25 73 77 63 85 81 | 16 86 56 41 20 51 25 52 73 40 74 32 15 61 99 34 60 85 77 30 5 27 63 35 81
|
||||||
|
Card 108: 65 59 24 72 54 66 14 81 67 31 | 94 92 83 67 50 19 61 6 42 55 60 97 22 18 24 40 86 43 72 56 5 75 63 45 90
|
||||||
|
Card 109: 90 87 3 17 80 96 36 93 34 79 | 51 11 29 96 13 66 70 99 72 67 64 42 37 30 55 98 35 12 15 84 5 10 57 19 49
|
||||||
|
Card 110: 57 82 85 42 23 76 70 64 88 21 | 65 32 76 81 7 43 23 52 55 14 70 58 27 82 48 64 85 47 57 16 46 97 68 21 45
|
||||||
|
Card 111: 50 62 66 33 93 43 56 70 77 35 | 94 79 19 16 35 41 78 32 91 4 14 3 13 48 63 36 75 98 64 69 27 96 77 51 74
|
||||||
|
Card 112: 6 36 83 73 59 48 65 12 29 92 | 12 36 82 52 8 35 88 69 9 28 89 39 87 20 22 67 27 63 75 73 70 58 31 78 79
|
||||||
|
Card 113: 25 10 29 67 87 32 54 92 62 43 | 65 19 67 75 79 29 8 73 62 97 82 87 25 18 32 93 49 5 66 27 68 42 43 11 46
|
||||||
|
Card 114: 29 44 96 86 64 37 4 71 94 98 | 5 27 55 76 33 59 68 77 3 96 15 1 46 20 35 61 53 83 78 69 99 97 34 30 25
|
||||||
|
Card 115: 32 90 91 88 39 66 37 35 12 21 | 85 82 71 37 87 22 72 17 35 9 58 95 64 12 33 90 68 66 15 43 4 7 91 8 84
|
||||||
|
Card 116: 75 50 66 77 51 36 98 23 97 28 | 4 66 44 20 35 76 51 83 58 89 91 87 75 27 10 47 1 60 97 90 77 45 63 59 36
|
||||||
|
Card 117: 85 44 56 82 39 64 30 88 79 20 | 71 88 53 27 36 85 13 11 38 91 77 19 3 99 23 73 39 44 24 45 32 15 58 79 56
|
||||||
|
Card 118: 80 41 82 32 1 52 91 40 66 11 | 72 3 4 29 77 87 36 40 16 46 66 30 92 76 98 49 85 7 32 28 60 86 52 95 83
|
||||||
|
Card 119: 50 66 77 26 2 49 9 25 58 81 | 80 49 50 55 16 56 20 42 31 99 69 26 28 85 66 65 70 90 84 53 40 19 60 12 38
|
||||||
|
Card 120: 48 9 95 85 16 70 81 61 57 92 | 2 58 66 10 34 54 7 94 16 14 25 74 92 49 88 13 57 26 99 97 70 75 65 19 17
|
||||||
|
Card 121: 50 76 20 25 53 17 2 78 85 86 | 14 40 78 89 93 48 1 28 11 4 54 71 5 69 85 61 38 94 66 64 98 95 30 67 23
|
||||||
|
Card 122: 62 92 40 16 25 82 64 87 52 53 | 5 19 25 48 38 42 1 99 51 79 2 78 75 57 81 56 70 47 59 91 90 6 9 24 15
|
||||||
|
Card 123: 50 91 29 69 41 73 44 51 13 26 | 66 55 22 6 17 71 1 3 67 24 88 79 65 64 60 34 7 90 78 72 28 83 82 74 10
|
||||||
|
Card 124: 61 77 51 39 73 4 6 25 53 91 | 54 88 26 11 3 79 10 86 23 49 66 21 47 85 5 2 98 7 1 60 55 13 94 34 62
|
||||||
|
Card 125: 31 67 93 63 21 28 12 85 39 57 | 69 46 22 59 55 75 11 97 70 1 94 14 81 96 79 44 18 36 85 34 56 48 30 72 15
|
||||||
|
Card 126: 31 89 5 98 63 36 40 48 91 12 | 91 42 6 47 51 94 48 83 5 77 98 8 11 50 29 9 36 54 89 40 12 63 31 34 73
|
||||||
|
Card 127: 41 88 97 87 13 80 74 49 24 6 | 43 66 62 47 36 87 6 88 24 49 96 56 25 79 8 76 23 97 41 42 80 89 13 73 74
|
||||||
|
Card 128: 7 6 3 99 56 40 80 27 23 43 | 34 64 97 67 3 78 69 43 57 98 96 4 6 94 62 48 23 68 8 1 58 73 75 65 16
|
||||||
|
Card 129: 46 80 39 32 35 41 61 93 57 47 | 40 63 93 89 61 4 45 46 25 96 80 39 35 14 62 95 49 32 47 2 41 99 57 82 44
|
||||||
|
Card 130: 90 10 79 84 88 76 59 18 62 11 | 79 11 53 97 92 5 88 52 23 60 62 64 86 84 14 20 98 91 10 28 24 29 87 65 3
|
||||||
|
Card 131: 95 50 11 76 61 4 2 8 42 47 | 40 15 46 61 8 2 29 97 65 50 19 83 76 95 59 82 48 57 43 72 42 25 31 47 53
|
||||||
|
Card 132: 49 86 99 81 13 98 69 32 89 18 | 89 84 65 58 32 15 96 49 1 18 22 13 98 99 6 81 46 50 88 78 3 11 69 74 86
|
||||||
|
Card 133: 18 56 75 7 48 40 38 22 10 90 | 10 42 61 18 91 38 12 67 72 54 51 22 86 77 81 87 75 34 89 97 35 6 96 7 62
|
||||||
|
Card 134: 67 66 99 61 98 32 6 82 86 9 | 12 8 33 87 82 66 98 78 68 24 59 80 6 44 32 49 9 2 97 65 86 71 99 61 67
|
||||||
|
Card 135: 24 59 92 68 44 20 30 8 40 77 | 28 72 51 38 58 40 30 24 21 77 92 82 59 18 50 7 19 44 20 68 91 8 32 88 94
|
||||||
|
Card 136: 27 10 70 96 29 69 37 63 86 65 | 28 27 8 34 29 82 78 56 22 30 3 19 63 88 67 74 75 4 91 41 35 65 7 14 66
|
||||||
|
Card 137: 74 70 86 34 89 37 73 23 29 85 | 16 65 58 88 8 5 11 26 39 91 51 31 19 78 92 87 36 34 80 94 42 81 38 40 93
|
||||||
|
Card 138: 71 35 5 13 69 8 88 11 76 31 | 69 42 5 59 76 54 37 11 39 9 12 73 66 13 71 89 56 26 28 77 2 31 1 4 57
|
||||||
|
Card 139: 10 50 78 91 55 61 81 19 44 59 | 97 98 39 52 56 28 94 24 3 54 45 82 14 17 5 16 27 99 37 38 26 31 53 9 35
|
||||||
|
Card 140: 17 93 15 73 45 20 43 50 2 52 | 64 21 15 57 77 90 2 61 22 8 91 39 93 82 62 5 47 30 41 80 58 1 17 25 48
|
||||||
|
Card 141: 52 66 4 8 87 11 14 76 23 24 | 3 55 29 16 26 61 12 43 89 15 56 24 5 36 85 62 90 75 65 71 53 45 38 50 54
|
||||||
|
Card 142: 57 35 91 73 66 67 64 63 92 18 | 96 58 44 37 19 41 72 54 52 31 88 20 45 68 42 21 2 59 62 53 70 63 77 57 69
|
||||||
|
Card 143: 88 70 69 13 18 97 64 89 40 29 | 74 98 30 5 85 12 38 62 66 33 36 17 71 9 97 22 47 79 39 60 89 13 83 77 8
|
||||||
|
Card 144: 14 35 52 8 75 43 62 33 36 70 | 13 95 71 64 6 48 74 84 61 24 89 77 17 58 87 75 76 43 28 54 3 83 99 67 12
|
||||||
|
Card 145: 53 88 65 42 72 92 43 14 3 90 | 21 19 33 59 84 61 96 41 20 31 88 71 38 72 79 48 58 55 62 36 23 11 30 18 70
|
||||||
|
Card 146: 68 28 58 96 42 32 22 90 19 47 | 84 25 39 96 67 26 29 24 9 62 1 14 46 11 77 81 61 82 60 80 78 52 31 98 49
|
||||||
|
Card 147: 81 85 76 67 4 63 25 97 57 27 | 2 26 43 9 56 59 29 10 13 45 35 60 86 65 15 46 19 5 79 8 44 1 6 20 21
|
||||||
|
Card 148: 90 41 37 66 94 87 84 14 9 29 | 94 47 5 10 23 38 61 87 55 22 75 97 37 29 30 9 18 84 69 41 11 73 43 45 14
|
||||||
|
Card 149: 84 30 17 21 47 26 81 68 57 40 | 86 78 70 5 54 40 34 38 47 72 62 56 53 7 10 37 73 92 46 61 41 74 68 23 63
|
||||||
|
Card 150: 83 21 33 53 37 57 66 29 41 6 | 20 61 75 89 59 60 41 83 21 29 30 57 66 58 37 76 90 96 53 69 33 17 12 95 6
|
||||||
|
Card 151: 12 5 52 36 3 29 69 6 82 27 | 82 12 27 44 50 15 76 28 29 52 57 36 73 3 34 5 94 37 6 92 84 9 10 98 69
|
||||||
|
Card 152: 82 62 80 30 37 68 41 89 12 5 | 60 32 64 57 41 74 89 16 72 20 26 6 91 18 52 68 62 55 5 30 82 1 37 80 12
|
||||||
|
Card 153: 97 28 55 92 70 83 58 44 67 40 | 24 58 55 88 92 40 6 83 12 70 10 22 44 76 82 97 4 98 65 28 5 32 7 67 74
|
||||||
|
Card 154: 31 50 70 87 43 26 55 30 14 54 | 43 72 90 20 10 13 91 54 75 39 26 70 17 87 22 60 29 1 27 69 14 31 50 67 55
|
||||||
|
Card 155: 21 4 25 52 3 16 98 43 72 81 | 87 4 21 43 90 67 39 36 13 64 6 25 29 16 83 84 5 98 9 81 78 1 74 12 96
|
||||||
|
Card 156: 77 46 21 67 59 78 63 30 45 48 | 48 35 17 62 44 25 34 67 23 13 63 81 99 29 93 84 73 96 86 90 88 30 60 85 21
|
||||||
|
Card 157: 43 32 99 39 58 3 38 81 79 41 | 79 41 34 8 99 80 70 43 51 38 29 68 32 83 58 2 6 36 63 95 81 67 3 28 10
|
||||||
|
Card 158: 43 68 57 98 30 58 47 40 12 93 | 91 62 48 6 52 16 72 34 28 85 81 94 26 4 99 30 71 44 80 65 40 60 58 18 49
|
||||||
|
Card 159: 62 30 18 57 61 68 65 98 10 56 | 98 32 29 1 15 77 55 10 13 30 80 93 38 86 70 99 97 19 85 33 17 21 48 47 89
|
||||||
|
Card 160: 30 47 79 28 57 77 73 75 35 40 | 98 25 96 11 15 34 19 35 6 38 1 91 29 57 61 22 69 12 40 21 41 17 27 39 56
|
||||||
|
Card 161: 62 58 10 14 73 95 77 97 47 70 | 15 46 1 36 3 66 27 77 49 45 94 65 23 61 76 8 91 42 82 13 85 67 92 68 53
|
||||||
|
Card 162: 47 24 44 73 3 10 30 98 5 29 | 75 99 37 41 60 43 13 67 74 23 82 40 35 64 77 25 4 9 58 56 8 7 85 70 66
|
||||||
|
Card 163: 10 17 99 41 6 14 81 23 5 84 | 95 11 99 62 53 23 8 73 48 42 96 47 39 94 56 30 58 63 22 66 33 26 35 5 43
|
||||||
|
Card 164: 71 32 31 15 73 3 70 91 61 18 | 3 16 77 70 33 94 62 40 88 32 90 98 66 49 86 68 95 7 53 97 96 28 4 75 35
|
||||||
|
Card 165: 61 74 1 76 17 22 19 83 5 96 | 83 5 47 29 52 40 94 32 70 95 67 84 56 31 18 62 42 9 53 36 57 48 64 15 85
|
||||||
|
Card 166: 84 96 57 6 48 13 42 12 19 99 | 67 29 25 81 77 69 63 56 8 27 80 62 94 30 78 10 45 49 20 95 50 66 61 6 24
|
||||||
|
Card 167: 21 41 29 39 24 98 68 40 7 78 | 44 19 53 13 17 4 2 64 87 60 1 51 10 35 94 52 25 75 92 95 80 67 82 42 86
|
||||||
|
Card 168: 18 72 92 63 3 38 82 65 85 61 | 53 14 92 63 74 75 97 56 85 82 30 4 42 34 18 61 72 65 20 47 43 3 38 39 40
|
||||||
|
Card 169: 98 91 13 27 52 51 36 82 80 78 | 78 42 51 62 36 38 4 95 82 17 91 27 12 98 76 13 84 52 80 32 39 50 48 19 2
|
||||||
|
Card 170: 94 67 3 32 73 84 11 47 23 90 | 94 84 66 73 32 31 23 18 93 29 58 81 95 16 46 53 89 4 11 44 49 67 90 82 40
|
||||||
|
Card 171: 2 55 5 19 59 73 29 65 12 23 | 33 75 5 53 90 95 68 73 29 71 11 45 72 54 59 12 55 85 56 19 17 24 8 92 2
|
||||||
|
Card 172: 74 43 65 15 59 37 11 83 20 85 | 59 30 36 97 78 65 88 20 96 11 51 22 93 63 94 28 3 90 68 95 73 43 13 74 85
|
||||||
|
Card 173: 53 46 64 33 65 55 8 81 1 36 | 12 22 78 35 57 96 36 3 27 29 52 80 2 79 8 76 93 54 1 24 48 32 94 14 64
|
||||||
|
Card 174: 20 38 12 24 28 39 18 59 75 94 | 95 48 91 36 56 63 62 46 67 4 32 97 39 66 93 55 50 34 5 85 29 76 45 54 7
|
||||||
|
Card 175: 26 96 12 74 65 57 51 18 83 75 | 26 89 74 83 65 12 58 88 92 22 8 39 18 51 34 96 75 44 94 35 30 90 69 57 23
|
||||||
|
Card 176: 48 64 15 96 42 33 88 27 50 86 | 36 85 60 68 93 63 33 17 28 70 24 50 96 38 54 53 72 90 41 86 74 88 75 64 48
|
||||||
|
Card 177: 66 27 35 76 89 90 31 26 20 95 | 51 94 62 77 31 5 16 20 30 86 75 42 23 11 69 24 87 76 27 60 80 46 43 57 90
|
||||||
|
Card 178: 83 38 10 89 18 80 1 67 63 7 | 37 28 46 84 94 89 38 21 24 68 25 92 60 34 58 54 76 55 11 19 85 33 93 15 8
|
||||||
|
Card 179: 59 82 88 8 21 16 55 2 56 45 | 2 26 73 81 90 5 13 55 21 82 69 8 22 99 36 68 53 88 86 56 16 7 45 87 28
|
||||||
|
Card 180: 95 5 4 34 30 73 98 89 6 37 | 7 28 72 6 95 37 68 4 34 98 82 73 84 8 65 5 89 57 15 42 56 45 69 11 74
|
||||||
|
Card 181: 85 69 79 50 37 34 11 84 5 89 | 4 35 99 48 21 97 93 25 8 37 47 79 34 16 76 26 55 67 50 75 63 15 58 84 5
|
||||||
|
Card 182: 70 10 57 74 60 93 9 41 79 32 | 19 18 96 8 49 2 50 94 93 4 23 89 11 39 38 97 58 56 82 21 13 28 65 47 29
|
||||||
|
Card 183: 53 70 11 25 1 37 32 4 78 45 | 23 54 83 35 11 41 1 47 18 60 36 71 10 64 95 49 69 32 45 46 61 9 4 52 25
|
||||||
|
Card 184: 71 31 19 43 12 93 30 56 17 27 | 61 20 92 50 33 17 51 89 45 24 39 64 23 18 52 2 41 46 63 84 88 7 99 27 78
|
||||||
|
Card 185: 44 55 78 43 18 33 69 81 82 9 | 39 57 42 79 76 67 58 1 26 63 54 82 70 22 66 55 15 38 74 96 46 53 51 28 99
|
||||||
|
Card 186: 25 76 9 33 59 42 82 6 79 4 | 10 50 20 18 93 95 62 40 22 70 48 16 75 15 49 81 64 94 6 21 73 80 78 77 83
|
||||||
|
Card 187: 43 33 83 89 36 31 86 22 13 14 | 3 78 63 34 8 38 23 16 81 80 54 1 95 92 60 24 82 49 44 68 62 46 66 97 28
|
||||||
|
Card 188: 81 6 49 46 11 77 99 82 84 51 | 36 45 18 87 48 35 86 7 83 31 38 61 92 98 70 78 74 59 63 66 15 85 47 96 1
|
||||||
|
Card 189: 50 43 3 38 20 80 40 70 82 74 | 29 55 1 2 45 97 59 49 60 79 88 90 94 57 12 24 47 61 5 52 95 75 63 48 32
|
||||||
|
Card 190: 22 66 97 81 70 24 53 76 17 35 | 92 59 1 36 97 70 34 77 69 55 17 81 62 67 71 91 58 24 76 87 45 30 33 35 22
|
||||||
|
Card 191: 20 65 9 10 98 71 60 83 51 34 | 68 51 10 26 20 4 56 24 34 9 65 83 60 55 5 27 8 43 71 98 14 21 32 48 64
|
||||||
|
Card 192: 92 77 16 8 1 87 51 14 89 76 | 13 10 60 19 93 97 16 11 51 47 76 30 91 24 14 89 77 35 8 28 87 21 92 1 22
|
||||||
|
Card 193: 53 24 36 45 60 18 35 25 12 28 | 98 29 92 35 52 99 12 45 74 18 28 30 70 68 55 24 25 77 81 36 72 20 53 50 60
|
||||||
|
Card 194: 50 83 40 8 87 28 79 27 44 91 | 37 80 88 17 90 40 67 87 20 76 77 52 68 1 55 35 14 61 4 96 75 83 10 71 8
|
||||||
|
Card 195: 6 41 29 40 96 49 9 55 51 18 | 69 30 77 83 47 52 59 55 70 10 92 19 85 11 86 42 53 38 35 90 51 46 80 91 84
|
||||||
|
Card 196: 92 29 86 97 9 30 87 6 15 4 | 18 46 50 63 30 14 6 82 3 53 55 26 29 86 85 70 4 89 90 24 10 35 27 9 20
|
||||||
|
Card 197: 80 1 81 94 98 75 58 9 19 10 | 26 37 57 58 22 1 19 94 10 87 70 5 95 40 53 81 89 93 8 80 86 9 36 75 98
|
||||||
|
Card 198: 29 41 51 44 7 84 65 62 20 74 | 74 5 72 62 41 88 23 49 66 97 31 84 18 51 20 10 29 19 44 7 1 60 40 78 30
|
||||||
|
Card 199: 20 2 3 95 63 60 10 81 87 90 | 60 54 3 61 38 77 42 32 62 82 90 35 9 81 2 20 87 63 8 65 95 19 30 10 85
|
||||||
|
Card 200: 80 76 17 57 36 9 70 65 1 13 | 88 50 96 87 77 36 14 70 86 29 68 90 93 3 25 65 74 83 78 62 9 69 47 22 8
|
||||||
|
Card 201: 19 43 79 93 31 72 66 7 18 55 | 72 20 71 43 57 19 53 83 47 35 37 67 13 31 74 81 76 18 44 55 93 97 26 84 11
|
||||||
|
Card 202: 26 65 71 57 14 86 49 66 1 23 | 27 41 16 51 82 72 13 55 14 21 69 62 15 46 63 78 22 31 30 57 76 45 3 71 86
|
||||||
|
Card 203: 53 43 69 4 76 74 73 11 34 88 | 46 68 63 19 55 64 88 51 33 15 17 57 53 42 76 66 80 34 11 69 73 96 59 74 16
|
||||||
|
Card 204: 9 6 64 82 79 1 73 68 39 57 | 92 82 49 53 84 4 69 20 30 13 16 1 26 76 60 57 91 65 24 12 34 56 33 38 59
|
||||||
|
Card 205: 45 6 76 94 78 35 95 20 85 90 | 89 94 28 15 48 87 56 32 40 88 21 33 51 53 54 67 64 9 17 78 6 57 12 98 95
|
||||||
|
Card 206: 32 94 53 98 84 82 48 45 8 25 | 84 4 25 97 12 93 35 60 42 80 61 62 18 8 32 17 94 23 63 53 31 3 48 43 20
|
||||||
|
Card 207: 40 18 52 70 55 29 49 43 15 20 | 38 39 78 70 35 81 34 29 51 55 17 43 52 64 16 21 69 27 47 88 2 99 18 54 3
|
||||||
|
Card 208: 9 67 74 14 59 41 84 60 73 86 | 87 16 27 86 50 7 30 77 64 76 73 71 99 92 23 82 2 5 55 57 40 47 45 72 21
|
||||||
|
Card 209: 45 50 11 39 28 93 77 92 41 18 | 32 6 56 34 15 87 48 64 41 30 3 46 42 21 44 72 59 29 25 77 83 66 5 12 11
|
||||||
|
Card 210: 34 74 60 33 14 25 27 98 54 75 | 90 79 69 27 70 4 40 93 66 62 65 3 8 42 34 92 53 98 56 89 57 13 52 38 30
|
||||||
|
Card 211: 20 21 98 93 33 65 13 48 81 53 | 19 82 78 95 77 54 89 61 58 74 39 43 1 64 73 11 72 7 32 9 17 46 8 84 86
|
||||||
|
Card 212: 46 82 24 14 63 38 94 70 79 91 | 23 83 87 4 48 81 40 13 84 68 22 65 45 11 88 75 98 1 15 56 64 44 35 7 3
|
||||||
|
Card 213: 79 84 12 86 58 10 11 24 32 26 | 52 94 65 29 89 7 76 80 31 21 78 37 66 69 13 41 93 73 96 16 92 44 62 3 95
|
47
2023/day4/main.py
Normal file
47
2023/day4/main.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
import re
|
||||||
|
import functools
|
||||||
|
|
||||||
|
cards = []
|
||||||
|
|
||||||
|
with open("input.txt", "r") as f:
|
||||||
|
for line in f:
|
||||||
|
card_no, numbers = line.strip().split(": ")
|
||||||
|
winning, mine = numbers.strip().split(" | ")
|
||||||
|
winning = re.split("\\s+", winning.strip())
|
||||||
|
mine = re.split("\\s+", mine.strip())
|
||||||
|
winning = list(map(int, winning))
|
||||||
|
mine = list(map(int, mine))
|
||||||
|
|
||||||
|
cards.append((winning, mine))
|
||||||
|
|
||||||
|
results = []
|
||||||
|
|
||||||
|
for winning, mine in cards:
|
||||||
|
my_winning_numbers = []
|
||||||
|
for my_number in mine:
|
||||||
|
if my_number in winning:
|
||||||
|
my_winning_numbers.append(my_number)
|
||||||
|
if len(my_winning_numbers) == 0:
|
||||||
|
results.append(0)
|
||||||
|
else:
|
||||||
|
results.append(2 ** (len(my_winning_numbers) - 1))
|
||||||
|
|
||||||
|
part1 = functools.reduce(lambda a, b: a + b, results)
|
||||||
|
print(part1)
|
||||||
|
|
||||||
|
card_counts = {}
|
||||||
|
|
||||||
|
for i, card in enumerate(cards):
|
||||||
|
card_counts[i] = 1
|
||||||
|
|
||||||
|
for i, (winning, mine) in enumerate(cards):
|
||||||
|
this_card_count = card_counts[i]
|
||||||
|
winning_count = 0
|
||||||
|
for my_number in mine:
|
||||||
|
if my_number in winning:
|
||||||
|
winning_count += 1
|
||||||
|
for next in range(1, winning_count + 1):
|
||||||
|
card_counts[i + next] += this_card_count
|
||||||
|
|
||||||
|
part2 = functools.reduce(lambda a, b: a + b, card_counts.values())
|
||||||
|
print(part2)
|
Loading…
Reference in a new issue