Finished 2023-12-04 part 1
This commit is contained in:
parent
d227e21bea
commit
e0a188f7c8
@ -51,6 +51,7 @@ def find_num(n,m):
|
|||||||
#print(arr[i[0]][i[1]-ctmp])
|
#print(arr[i[0]][i[1]-ctmp])
|
||||||
num = str(arr[i[0]][i[1]-ctmp]) + num
|
num = str(arr[i[0]][i[1]-ctmp]) + num
|
||||||
ctmp = ctmp + 1
|
ctmp = ctmp + 1
|
||||||
|
#print("Found ",end="")
|
||||||
left = True
|
left = True
|
||||||
ctmp = 1
|
ctmp = 1
|
||||||
#print(i[1]+ctmp)
|
#print(i[1]+ctmp)
|
||||||
|
188
2023/day4/input
Normal file
188
2023/day4/input
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
Card 1: 95 57 30 62 11 5 9 3 72 87 | 94 72 74 98 23 57 62 14 30 3 73 49 80 96 20 60 17 35 11 63 87 9 6 5 95
|
||||||
|
Card 2: 65 16 99 4 48 52 84 7 26 12 | 86 7 71 12 52 4 84 15 48 20 16 3 10 87 56 99 26 66 88 65 98 32 14 51 59
|
||||||
|
Card 3: 19 70 1 34 10 79 23 58 64 68 | 95 14 64 53 19 63 83 46 77 75 3 12 70 65 22 13 66 34 23 89 94 50 69 79 68
|
||||||
|
Card 4: 27 57 62 6 53 68 97 35 23 8 | 23 2 81 62 19 8 65 27 93 53 57 67 6 91 68 97 16 30 12 96 15 35 25 55 43
|
||||||
|
Card 5: 49 95 30 21 42 63 92 97 89 93 | 35 34 46 89 93 29 42 21 63 49 77 30 95 27 28 62 72 32 97 54 75 56 4 58 92
|
||||||
|
Card 6: 7 39 29 54 34 40 63 64 32 23 | 88 4 54 73 32 18 36 31 19 35 61 94 28 40 23 41 96 59 14 48 77 29 39 21 33
|
||||||
|
Card 7: 20 58 79 66 51 65 72 27 62 67 | 37 7 90 62 3 17 88 58 86 28 55 42 15 20 79 94 38 92 76 41 30 93 25 24 14
|
||||||
|
Card 8: 3 83 96 15 95 72 63 87 74 78 | 16 74 6 49 15 87 46 3 64 90 82 85 2 78 32 9 97 96 70 95 63 72 54 83 38
|
||||||
|
Card 9: 40 74 17 75 12 97 71 15 30 83 | 13 21 15 12 8 81 50 7 44 67 6 40 30 76 22 75 42 79 5 97 83 60 71 47 74
|
||||||
|
Card 10: 47 96 36 45 84 14 65 7 69 38 | 36 38 85 14 87 95 7 24 69 29 68 65 26 94 84 78 83 45 98 9 2 20 93 96 47
|
||||||
|
Card 11: 22 5 16 86 91 96 27 39 8 30 | 14 98 84 51 11 5 23 36 40 81 82 78 13 2 43 39 42 68 34 71 10 38 61 70 46
|
||||||
|
Card 12: 57 95 65 48 50 46 69 61 58 70 | 64 69 52 84 93 65 61 37 25 22 31 6 46 83 50 48 75 58 59 98 95 70 19 51 57
|
||||||
|
Card 13: 67 63 56 28 11 81 43 60 93 57 | 61 67 82 60 7 11 98 78 50 33 84 64 74 63 28 15 56 66 39 57 69 54 65 8 12
|
||||||
|
Card 14: 30 97 48 84 86 1 59 83 8 44 | 70 94 38 62 71 79 47 99 68 93 67 15 33 57 60 72 50 31 88 20 82 40 18 63 29
|
||||||
|
Card 15: 7 2 46 28 61 63 17 95 32 47 | 56 97 17 93 36 78 16 25 18 33 61 90 10 55 82 26 2 69 43 22 96 37 64 74 95
|
||||||
|
Card 16: 45 90 36 48 81 64 68 58 4 66 | 31 36 34 41 46 56 2 74 50 57 93 86 22 60 43 24 12 17 73 79 15 63 82 97 32
|
||||||
|
Card 17: 1 82 47 86 6 33 52 51 98 91 | 88 98 26 33 82 93 16 45 65 68 47 96 39 83 14 86 61 71 75 90 3 54 59 77 9
|
||||||
|
Card 18: 43 73 13 32 98 11 15 12 97 99 | 83 15 60 62 95 36 98 16 51 79 20 24 73 46 5 67 12 32 11 84 89 23 93 59 74
|
||||||
|
Card 19: 54 93 71 65 66 56 26 97 33 24 | 67 24 89 17 99 18 5 54 26 14 57 10 3 33 91 94 16 80 97 49 12 46 19 75 38
|
||||||
|
Card 20: 65 10 75 93 72 62 29 69 59 66 | 58 55 56 87 66 88 7 34 36 62 4 35 67 90 33 52 99 17 32 68 80 79 40 48 31
|
||||||
|
Card 21: 93 75 39 12 21 77 99 46 4 24 | 39 19 98 59 43 14 28 9 89 81 1 5 63 87 48 95 41 36 29 27 44 15 50 17 18
|
||||||
|
Card 22: 78 39 74 11 41 24 9 33 68 45 | 41 66 29 79 15 90 62 60 95 69 57 55 81 33 20 89 76 65 56 77 61 18 88 75 19
|
||||||
|
Card 23: 64 16 33 77 80 89 90 50 57 4 | 46 94 45 42 82 61 67 3 76 74 96 79 7 70 73 97 11 34 35 72 55 51 36 12 13
|
||||||
|
Card 24: 40 13 83 79 42 70 26 33 7 12 | 95 17 5 74 68 28 46 21 96 43 73 47 18 86 54 88 82 61 85 51 11 9 56 20 75
|
||||||
|
Card 25: 97 54 33 84 85 49 4 26 25 67 | 22 41 72 84 25 16 85 8 83 62 15 33 97 17 38 67 69 51 45 77 28 87 24 54 4
|
||||||
|
Card 26: 54 22 60 99 15 96 80 3 5 64 | 96 65 54 38 60 87 8 15 80 10 3 32 22 56 43 5 44 14 78 18 97 64 25 63 99
|
||||||
|
Card 27: 88 93 30 77 33 46 38 66 7 20 | 96 75 30 77 83 76 54 46 15 66 38 88 55 40 22 21 34 42 29 20 71 16 28 61 18
|
||||||
|
Card 28: 48 85 39 25 47 80 98 33 68 66 | 50 82 40 60 84 46 29 51 25 47 11 22 58 64 36 2 63 92 80 15 72 27 37 98 10
|
||||||
|
Card 29: 85 92 67 13 70 60 9 35 18 98 | 44 16 66 33 81 56 58 73 64 85 39 40 49 63 23 17 19 1 28 62 2 65 10 68 11
|
||||||
|
Card 30: 15 64 30 28 6 97 69 38 17 79 | 92 50 33 24 85 6 38 44 91 28 35 58 90 97 39 79 64 80 84 22 15 66 2 45 17
|
||||||
|
Card 31: 7 74 79 40 62 55 16 48 59 97 | 31 70 34 85 23 17 4 92 12 66 1 50 43 87 27 64 11 28 26 47 94 2 36 15 39
|
||||||
|
Card 32: 97 95 38 61 7 22 36 94 47 4 | 21 37 44 88 77 33 11 12 91 27 80 67 25 83 17 45 89 61 98 40 59 76 96 71 1
|
||||||
|
Card 33: 15 35 9 39 25 62 57 19 81 47 | 64 57 71 56 35 25 33 1 76 97 48 84 44 79 82 39 19 74 78 59 14 49 81 29 11
|
||||||
|
Card 34: 97 3 81 82 28 40 35 67 38 85 | 36 76 21 89 38 34 43 10 85 9 99 83 68 94 47 19 17 91 41 26 20 30 63 25 69
|
||||||
|
Card 35: 43 49 58 92 57 71 56 28 33 3 | 32 1 70 43 29 93 54 63 58 27 14 28 51 31 81 57 25 50 87 90 82 73 97 7 12
|
||||||
|
Card 36: 18 85 61 97 29 25 66 28 11 62 | 44 26 46 65 83 59 30 66 68 47 90 93 15 84 9 7 72 1 95 87 3 20 23 81 86
|
||||||
|
Card 37: 97 22 74 4 43 78 76 8 26 1 | 4 93 24 5 80 37 48 12 59 32 50 71 66 69 52 23 34 25 57 89 51 99 41 56 63
|
||||||
|
Card 38: 20 57 93 41 87 71 76 29 33 66 | 63 56 49 11 64 2 62 68 82 8 67 81 41 4 78 17 85 97 69 35 19 47 30 95 65
|
||||||
|
Card 39: 6 81 87 68 29 23 76 9 44 33 | 74 71 60 82 98 72 85 57 7 96 84 30 19 3 35 12 22 50 15 26 94 65 62 61 83
|
||||||
|
Card 40: 96 61 74 3 10 54 58 86 97 87 | 16 37 57 5 72 93 74 45 88 67 97 54 69 2 71 58 46 96 87 44 10 20 86 28 3
|
||||||
|
Card 41: 28 83 7 40 32 56 82 70 14 22 | 82 81 37 73 76 65 35 56 17 40 83 29 39 6 80 61 25 28 31 32 1 38 42 85 8
|
||||||
|
Card 42: 16 47 55 93 99 1 7 72 12 40 | 78 2 26 88 9 98 40 47 61 77 23 1 66 27 55 5 72 67 50 12 85 83 90 71 25
|
||||||
|
Card 43: 17 94 80 60 24 12 20 66 99 41 | 53 69 76 97 15 54 29 73 98 33 30 45 24 19 70 66 16 78 6 90 61 96 32 89 46
|
||||||
|
Card 44: 16 20 87 88 90 27 69 81 79 70 | 52 70 85 7 13 87 34 26 60 82 15 88 69 79 58 62 75 44 42 49 48 11 97 16 27
|
||||||
|
Card 45: 72 9 25 20 48 79 15 2 49 67 | 4 3 60 85 48 73 15 98 25 84 95 80 22 7 58 72 44 67 79 20 40 70 1 29 13
|
||||||
|
Card 46: 86 95 61 42 30 43 1 72 19 53 | 65 88 13 2 3 30 51 7 5 19 74 25 56 50 10 32 43 85 78 61 99 12 75 42 80
|
||||||
|
Card 47: 80 62 17 58 21 95 18 65 19 54 | 23 1 28 41 80 46 18 17 35 54 19 40 43 62 96 77 45 90 13 21 12 66 52 53 65
|
||||||
|
Card 48: 52 43 23 72 73 82 9 19 60 83 | 35 29 60 57 22 46 78 39 86 27 92 90 19 71 28 44 41 40 52 79 6 50 15 82 21
|
||||||
|
Card 49: 10 19 28 81 32 46 42 8 54 16 | 42 93 82 62 95 67 59 8 87 36 28 35 38 31 75 70 96 10 56 1 54 44 4 88 24
|
||||||
|
Card 50: 12 66 62 83 81 13 2 38 85 57 | 73 95 59 70 54 93 71 35 25 75 82 46 14 21 76 32 8 81 68 42 79 44 34 41 55
|
||||||
|
Card 51: 62 51 82 74 97 93 49 94 76 58 | 4 46 69 1 33 38 68 89 59 91 57 67 3 92 19 53 77 50 94 48 62 26 98 9 81
|
||||||
|
Card 52: 52 51 23 12 82 32 96 89 47 55 | 12 4 60 90 17 35 52 64 94 43 27 14 9 25 6 66 41 68 38 56 37 19 55 85 69
|
||||||
|
Card 53: 23 59 46 4 62 48 71 20 50 1 | 41 77 25 16 35 34 44 81 65 17 78 15 42 12 72 55 57 3 58 88 40 95 66 13 74
|
||||||
|
Card 54: 43 96 23 40 48 38 10 21 8 20 | 98 88 67 99 97 56 54 1 29 57 37 69 63 32 89 35 41 85 11 49 74 36 28 65 91
|
||||||
|
Card 55: 9 66 49 29 54 15 36 93 50 13 | 84 79 55 53 41 8 78 89 18 40 56 61 45 7 88 63 37 4 67 85 90 28 34 51 10
|
||||||
|
Card 56: 51 99 43 34 16 30 8 36 71 88 | 99 36 8 16 71 28 43 29 61 94 92 48 77 58 51 34 88 67 47 30 54 14 66 70 68
|
||||||
|
Card 57: 46 90 29 80 82 93 4 66 57 91 | 90 57 74 20 54 42 93 60 88 80 5 78 82 51 7 29 4 55 33 89 32 12 27 63 44
|
||||||
|
Card 58: 46 16 53 11 58 63 65 93 99 36 | 22 29 59 91 79 40 95 68 67 99 88 87 13 73 54 8 49 20 16 94 9 43 47 4 98
|
||||||
|
Card 59: 57 93 76 90 32 22 30 9 98 88 | 48 93 22 33 14 92 80 3 2 17 82 54 42 63 41 74 56 87 45 52 71 35 70 32 60
|
||||||
|
Card 60: 26 74 89 84 81 10 79 99 75 11 | 86 81 64 26 54 35 66 99 84 53 89 79 13 75 24 98 60 19 94 74 5 11 49 10 23
|
||||||
|
Card 61: 51 99 9 36 82 83 40 25 97 39 | 2 82 72 65 7 17 63 28 16 84 34 56 37 81 25 13 26 50 73 51 40 94 49 8 39
|
||||||
|
Card 62: 98 72 92 16 2 68 65 61 20 78 | 89 60 42 83 20 7 64 36 77 95 63 37 39 4 74 75 25 67 9 58 49 2 87 10 68
|
||||||
|
Card 63: 17 86 72 89 44 30 21 64 36 84 | 72 30 91 27 31 50 64 7 25 9 89 84 17 86 92 71 13 63 36 2 41 28 33 94 82
|
||||||
|
Card 64: 9 71 80 49 16 90 92 17 39 45 | 53 9 30 93 7 12 98 87 45 16 67 71 90 18 17 31 42 36 39 48 47 85 19 97 95
|
||||||
|
Card 65: 76 39 34 30 80 38 16 45 46 58 | 16 79 45 51 40 67 31 49 30 22 85 63 57 34 76 80 3 48 46 36 38 58 19 55 6
|
||||||
|
Card 66: 97 57 52 42 67 92 28 6 7 73 | 55 79 71 61 94 86 83 35 72 78 4 58 10 51 73 89 68 92 42 24 69 57 91 7 43
|
||||||
|
Card 67: 99 35 28 30 61 98 51 73 4 85 | 90 34 58 69 21 59 36 97 96 98 44 47 12 15 61 29 28 42 99 51 52 71 19 40 73
|
||||||
|
Card 68: 72 30 78 60 61 91 14 73 76 47 | 46 41 40 6 94 56 16 45 60 20 33 24 43 1 88 67 62 68 2 84 29 12 4 96 74
|
||||||
|
Card 69: 14 20 41 89 85 13 98 6 33 4 | 36 99 26 58 49 55 16 68 15 52 30 35 28 21 82 57 65 56 7 37 3 20 14 47 22
|
||||||
|
Card 70: 93 18 99 57 25 81 95 4 58 37 | 24 66 67 61 34 55 85 37 78 30 75 79 3 32 83 33 10 52 69 98 20 45 2 68 44
|
||||||
|
Card 71: 47 27 78 40 34 56 59 62 26 93 | 50 18 84 99 64 10 97 22 85 20 15 19 72 31 58 89 37 6 26 44 68 60 43 21 17
|
||||||
|
Card 72: 28 18 7 3 11 94 85 44 90 40 | 59 2 49 16 27 42 72 33 50 5 92 37 88 55 95 11 62 7 52 23 41 74 98 35 30
|
||||||
|
Card 73: 1 46 31 33 20 19 97 89 15 45 | 50 77 71 24 88 87 74 95 56 44 42 70 4 75 96 25 21 11 59 47 29 35 83 2 85
|
||||||
|
Card 74: 88 55 81 82 51 18 48 12 72 19 | 41 78 28 96 83 5 33 60 3 73 53 85 22 4 50 61 98 23 32 68 34 80 49 75 36
|
||||||
|
Card 75: 17 93 50 45 57 97 39 3 87 32 | 79 87 59 15 1 71 54 37 80 85 14 93 45 3 24 50 94 74 75 64 55 97 17 76 21
|
||||||
|
Card 76: 37 19 35 66 32 28 43 68 13 86 | 68 45 91 37 33 69 35 24 1 14 58 25 52 3 50 70 62 64 94 32 49 13 28 43 21
|
||||||
|
Card 77: 5 6 46 30 74 35 48 94 26 88 | 82 55 59 35 74 92 36 26 48 5 7 98 27 42 60 94 11 71 6 33 23 30 56 25 46
|
||||||
|
Card 78: 27 81 2 26 70 83 28 75 15 82 | 47 25 73 15 36 86 93 90 46 37 1 28 75 89 49 83 2 79 81 27 9 44 82 70 61
|
||||||
|
Card 79: 35 38 41 81 18 89 9 34 55 16 | 21 31 76 69 50 45 88 63 89 70 15 96 99 8 67 42 20 59 74 19 48 37 98 10 39
|
||||||
|
Card 80: 97 65 69 37 10 86 57 41 15 31 | 17 58 2 50 45 27 33 73 96 12 29 86 60 74 89 81 51 95 37 41 75 98 38 93 20
|
||||||
|
Card 81: 12 6 42 18 14 74 61 85 47 28 | 13 49 34 78 81 75 57 11 95 3 69 27 2 42 44 76 54 4 68 48 24 53 52 20 15
|
||||||
|
Card 82: 40 27 39 47 34 78 31 79 91 12 | 63 6 76 5 50 8 86 96 99 57 82 87 7 37 95 56 28 26 77 67 45 17 51 66 30
|
||||||
|
Card 83: 38 96 19 65 28 70 54 95 62 15 | 29 26 46 50 32 18 89 93 22 24 1 52 2 39 59 86 69 56 72 58 25 70 54 7 10
|
||||||
|
Card 84: 76 89 49 56 46 1 83 64 73 40 | 19 60 49 99 18 28 54 73 32 38 97 87 2 79 8 61 12 93 35 20 52 51 58 3 21
|
||||||
|
Card 85: 77 86 68 78 37 82 93 17 15 36 | 9 19 79 80 39 8 15 54 68 27 98 50 46 41 88 12 34 47 76 93 81 7 35 85 73
|
||||||
|
Card 86: 68 22 45 20 26 79 88 44 46 90 | 84 19 67 86 49 18 21 65 23 6 57 90 75 28 51 83 4 56 26 98 38 5 3 80 63
|
||||||
|
Card 87: 43 34 86 6 75 41 38 17 22 61 | 54 95 20 36 72 28 59 90 40 50 63 81 89 30 92 32 26 78 53 42 46 15 73 51 7
|
||||||
|
Card 88: 15 32 22 2 63 17 62 94 99 83 | 44 25 22 16 58 54 67 4 92 8 75 27 41 99 53 97 76 5 51 32 78 74 73 81 45
|
||||||
|
Card 89: 67 75 27 99 94 7 57 15 40 65 | 61 42 96 13 53 56 3 63 70 41 69 28 86 11 54 16 34 22 31 76 14 5 43 79 77
|
||||||
|
Card 90: 10 49 37 75 89 18 62 16 65 13 | 8 67 79 40 27 23 15 56 69 71 5 85 87 88 14 74 22 19 64 98 93 35 18 82 31
|
||||||
|
Card 91: 73 28 59 31 18 92 69 84 38 52 | 86 70 65 90 53 95 45 33 16 94 23 71 25 34 26 98 13 87 55 8 1 49 6 93 63
|
||||||
|
Card 92: 18 60 22 23 16 6 88 4 32 44 | 37 88 46 75 97 6 22 9 5 18 92 32 16 4 49 82 13 60 44 26 28 86 8 12 23
|
||||||
|
Card 93: 14 39 72 74 69 9 4 13 57 7 | 22 6 96 21 23 80 50 83 55 81 30 1 79 92 34 32 95 91 11 76 85 12 73 99 89
|
||||||
|
Card 94: 38 18 52 85 43 3 89 63 78 77 | 78 35 89 77 96 27 38 46 3 58 84 37 85 4 13 52 80 7 21 50 63 42 86 28 43
|
||||||
|
Card 95: 72 18 32 20 23 9 43 97 71 30 | 21 29 14 50 5 48 35 15 58 75 24 73 81 88 82 13 98 86 26 33 70 64 96 11 90
|
||||||
|
Card 96: 36 27 25 77 60 63 49 1 39 31 | 29 78 5 67 77 24 71 59 22 73 6 69 99 88 37 25 21 47 42 61 2 40 26 45 23
|
||||||
|
Card 97: 40 74 36 19 92 51 78 44 96 20 | 18 98 69 94 73 40 82 45 38 44 78 58 57 32 99 14 34 63 35 92 3 83 4 84 75
|
||||||
|
Card 98: 57 55 61 60 77 56 50 33 48 47 | 61 77 33 86 75 47 65 50 48 84 10 55 14 28 19 53 3 46 83 31 1 51 89 56 57
|
||||||
|
Card 99: 93 47 74 10 37 90 76 1 40 54 | 62 72 8 28 79 84 23 75 2 45 96 32 16 71 56 14 13 63 78 30 12 55 65 46 91
|
||||||
|
Card 100: 15 33 70 46 11 23 24 69 47 5 | 6 68 69 86 55 3 50 43 45 75 36 97 91 20 15 77 21 23 17 71 70 82 42 35 9
|
||||||
|
Card 101: 40 41 98 7 73 21 47 68 59 1 | 11 79 77 37 48 96 92 30 18 24 31 88 49 99 14 23 82 35 42 16 22 84 8 75 32
|
||||||
|
Card 102: 92 51 37 63 18 54 28 58 40 4 | 10 94 9 42 64 11 91 23 50 30 90 81 74 77 65 24 49 60 19 70 79 83 76 72 99
|
||||||
|
Card 103: 66 62 18 43 33 50 51 30 22 63 | 20 68 54 91 55 14 1 31 71 38 80 86 81 87 89 53 42 83 65 64 30 73 6 61 2
|
||||||
|
Card 104: 2 86 13 94 18 9 74 35 49 91 | 82 21 12 51 25 10 89 6 73 95 2 16 83 36 49 64 3 87 41 78 27 98 67 56 7
|
||||||
|
Card 105: 51 42 19 18 31 2 29 80 99 65 | 27 55 14 37 52 11 25 5 30 73 41 32 76 28 50 69 88 66 22 74 40 21 13 35 90
|
||||||
|
Card 106: 6 19 88 46 69 13 49 20 63 31 | 47 32 72 78 79 53 55 75 98 16 76 52 93 17 27 77 74 45 44 60 10 91 3 87 30
|
||||||
|
Card 107: 11 42 78 2 9 91 46 51 68 88 | 30 7 18 76 94 87 50 57 73 14 54 36 80 59 71 61 20 64 5 44 55 93 27 74 24
|
||||||
|
Card 108: 4 79 42 25 54 92 93 88 90 81 | 86 92 79 4 52 58 3 65 95 14 42 59 15 81 12 39 90 25 98 49 38 63 27 84 88
|
||||||
|
Card 109: 65 16 49 63 6 37 48 75 77 19 | 16 73 6 25 14 28 27 75 49 11 61 77 76 19 85 95 63 37 33 88 48 22 65 72 31
|
||||||
|
Card 110: 83 63 27 82 72 40 70 35 12 86 | 14 96 39 40 72 56 8 83 63 43 42 86 91 58 48 70 3 73 22 35 82 33 29 31 12
|
||||||
|
Card 111: 36 31 68 37 83 23 9 39 12 26 | 80 92 71 20 48 37 53 32 75 31 83 58 9 26 77 52 42 68 70 7 72 36 23 87 50
|
||||||
|
Card 112: 94 61 81 68 89 42 52 92 74 39 | 94 89 15 76 86 92 65 57 84 2 21 81 49 68 42 39 90 31 13 27 69 61 3 74 52
|
||||||
|
Card 113: 68 9 32 67 96 43 14 15 28 48 | 2 81 58 90 45 89 53 34 39 7 46 55 20 69 25 66 17 54 44 19 93 23 92 26 10
|
||||||
|
Card 114: 25 77 57 50 59 16 46 80 2 14 | 58 14 78 81 8 75 21 45 50 67 55 1 51 92 20 25 86 32 72 54 65 44 38 91 70
|
||||||
|
Card 115: 11 10 76 79 84 82 16 14 43 6 | 84 59 20 63 79 33 23 47 40 17 48 80 76 25 83 16 82 89 6 11 10 97 44 43 14
|
||||||
|
Card 116: 21 1 37 82 29 36 57 76 68 63 | 86 38 20 14 36 8 7 31 68 21 56 1 63 26 28 57 96 54 29 82 37 76 61 71 40
|
||||||
|
Card 117: 4 7 73 26 78 49 22 11 74 35 | 76 26 57 22 66 36 73 35 16 77 87 49 32 54 92 43 7 15 20 38 8 82 29 78 11
|
||||||
|
Card 118: 58 12 45 87 44 90 48 72 77 66 | 34 57 66 52 90 98 4 99 21 80 8 3 18 45 79 23 50 10 43 62 54 60 39 29 33
|
||||||
|
Card 119: 58 97 56 38 78 75 84 99 7 32 | 92 33 78 72 7 84 64 18 38 43 27 32 21 99 85 40 58 93 97 13 3 75 56 25 46
|
||||||
|
Card 120: 40 31 79 63 24 20 11 56 92 32 | 63 32 92 22 1 30 79 20 58 53 64 24 56 36 81 6 49 48 17 26 73 83 47 3 8
|
||||||
|
Card 121: 51 39 2 99 40 21 4 8 14 46 | 11 29 41 74 55 73 16 95 21 30 85 81 2 76 59 99 9 51 58 8 44 43 61 27 25
|
||||||
|
Card 122: 29 76 10 60 87 27 35 65 37 59 | 59 53 46 17 1 48 36 88 95 85 13 41 67 31 90 39 99 24 51 11 84 42 96 91 92
|
||||||
|
Card 123: 99 34 55 8 23 83 28 26 21 54 | 99 8 2 10 26 76 11 52 95 73 38 74 23 92 59 57 71 56 1 13 93 87 43 4 70
|
||||||
|
Card 124: 75 96 37 43 92 85 68 78 18 4 | 71 43 78 96 92 62 76 19 39 21 52 29 36 93 81 33 53 2 10 69 82 87 14 85 68
|
||||||
|
Card 125: 11 32 49 86 21 95 94 64 77 23 | 53 25 9 94 75 21 10 35 95 81 39 41 90 18 45 43 78 73 63 56 27 74 46 17 85
|
||||||
|
Card 126: 8 64 16 62 90 93 98 27 57 4 | 39 89 62 42 60 33 90 3 44 32 8 13 24 85 5 93 68 55 73 22 4 52 28 58 12
|
||||||
|
Card 127: 22 52 46 90 56 44 84 62 48 8 | 46 86 7 72 80 58 38 76 53 12 83 22 15 60 84 14 33 17 52 49 88 93 36 4 71
|
||||||
|
Card 128: 49 31 89 7 43 41 27 58 74 72 | 92 24 40 95 80 84 2 19 70 29 83 69 42 17 39 67 97 98 32 56 23 59 21 5 68
|
||||||
|
Card 129: 92 50 77 38 85 25 5 72 34 84 | 39 38 55 26 58 83 75 70 80 94 42 9 12 69 29 88 50 3 62 96 13 48 93 44 22
|
||||||
|
Card 130: 45 23 32 47 89 28 9 95 94 14 | 53 78 75 3 50 29 65 60 1 98 15 13 36 71 52 21 66 19 73 67 91 37 76 26 56
|
||||||
|
Card 131: 70 27 15 12 83 23 96 57 90 77 | 14 34 88 74 59 68 94 44 99 39 40 78 47 17 43 42 80 9 73 93 41 25 71 22 75
|
||||||
|
Card 132: 16 32 43 64 77 1 14 78 97 98 | 78 97 64 75 52 98 13 81 16 57 3 9 14 83 32 28 56 58 1 43 87 12 77 24 31
|
||||||
|
Card 133: 95 53 4 45 36 20 77 60 8 49 | 2 62 83 20 53 95 57 86 8 45 38 63 49 82 85 26 36 60 89 81 92 51 54 4 99
|
||||||
|
Card 134: 95 23 88 8 52 67 46 15 36 55 | 74 44 67 8 94 88 82 46 6 34 64 23 36 14 19 91 15 72 98 56 55 95 65 13 52
|
||||||
|
Card 135: 27 40 81 65 23 49 89 67 4 32 | 75 32 8 40 16 27 38 54 48 67 22 42 85 57 4 97 76 81 82 28 55 65 2 72 23
|
||||||
|
Card 136: 7 35 1 24 95 80 25 4 75 37 | 73 28 64 72 56 66 55 29 52 2 80 98 11 41 16 78 75 89 35 12 85 69 24 42 39
|
||||||
|
Card 137: 19 38 84 95 77 68 50 70 16 17 | 71 69 30 27 86 7 35 96 33 74 20 93 36 47 6 55 29 32 78 72 58 46 21 99 9
|
||||||
|
Card 138: 97 58 41 82 43 64 26 81 2 36 | 55 79 30 88 96 99 34 82 25 6 71 44 54 77 91 11 90 80 76 40 92 69 64 29 15
|
||||||
|
Card 139: 41 27 9 87 98 24 72 58 2 88 | 93 72 58 89 34 23 24 48 49 98 78 50 87 64 2 14 85 21 62 75 88 60 41 53 16
|
||||||
|
Card 140: 79 92 45 91 75 2 1 57 66 40 | 42 82 45 28 75 91 1 11 63 17 20 54 27 92 48 40 12 57 69 66 2 21 19 88 79
|
||||||
|
Card 141: 33 4 49 55 78 9 61 83 58 50 | 50 9 94 83 98 78 14 66 67 61 71 4 72 39 49 40 29 30 36 16 47 3 58 19 33
|
||||||
|
Card 142: 80 32 49 19 43 42 50 86 97 87 | 42 15 71 58 18 85 80 19 97 86 32 62 95 44 56 50 83 28 51 34 33 43 36 87 49
|
||||||
|
Card 143: 76 89 44 30 69 84 47 85 42 23 | 54 17 16 52 86 48 81 92 1 7 78 64 66 59 21 55 36 58 46 37 6 61 89 72 82
|
||||||
|
Card 144: 22 9 57 50 38 82 66 70 92 37 | 71 18 63 27 87 34 23 13 39 92 77 60 74 46 50 48 57 54 66 22 59 83 44 9 70
|
||||||
|
Card 145: 56 90 36 66 70 16 73 62 4 37 | 18 34 96 7 47 65 99 56 58 75 85 31 36 3 90 70 5 66 83 62 73 16 55 37 4
|
||||||
|
Card 146: 68 59 27 32 62 43 25 22 42 3 | 67 68 59 70 98 16 8 25 24 22 44 53 63 11 6 65 54 74 81 32 91 50 13 62 99
|
||||||
|
Card 147: 21 95 4 18 23 68 83 36 29 3 | 94 42 90 33 50 39 41 66 58 8 96 83 15 85 56 93 14 99 67 37 5 61 24 4 3
|
||||||
|
Card 148: 13 22 23 39 61 17 50 28 25 19 | 86 92 67 42 85 22 17 19 7 5 39 55 47 20 64 25 50 66 31 30 61 41 18 89 74
|
||||||
|
Card 149: 24 79 8 18 15 97 95 13 33 89 | 72 18 13 85 89 49 47 1 11 84 40 50 44 71 15 53 43 26 8 86 23 22 83 21 97
|
||||||
|
Card 150: 98 78 63 19 91 86 1 9 55 35 | 41 33 95 85 83 20 66 23 86 94 8 87 43 37 71 58 21 14 96 3 29 6 39 53 32
|
||||||
|
Card 151: 47 78 1 40 26 97 61 73 24 21 | 59 60 94 4 52 42 92 19 23 57 82 88 70 45 43 96 7 72 26 58 71 6 16 53 8
|
||||||
|
Card 152: 3 79 50 95 26 91 66 60 71 53 | 12 96 93 92 49 5 9 76 30 8 23 58 63 73 94 10 19 46 39 55 33 87 18 78 86
|
||||||
|
Card 153: 2 55 64 32 42 68 63 52 50 90 | 60 20 30 16 98 85 1 35 97 33 64 65 79 12 51 78 48 49 86 50 57 99 3 10 46
|
||||||
|
Card 154: 4 72 77 78 27 68 37 57 82 91 | 38 39 36 23 43 53 71 24 63 64 89 80 49 97 60 47 21 90 93 48 70 86 65 66 3
|
||||||
|
Card 155: 90 34 33 91 74 28 36 4 5 39 | 51 23 30 73 37 97 99 25 32 54 67 52 75 48 38 78 42 35 13 6 81 63 49 83 80
|
||||||
|
Card 156: 38 8 26 2 43 32 72 45 29 5 | 77 89 32 45 73 34 23 80 1 78 5 86 19 38 7 59 75 29 8 43 26 72 20 12 2
|
||||||
|
Card 157: 42 20 82 74 94 44 54 33 69 93 | 94 98 34 54 20 68 82 18 13 53 33 67 22 42 72 16 62 6 25 17 46 56 87 9 7
|
||||||
|
Card 158: 41 46 13 9 93 48 65 76 3 4 | 10 67 53 57 44 18 47 13 98 59 6 52 5 91 17 54 97 61 68 26 25 42 40 72 22
|
||||||
|
Card 159: 73 1 50 18 66 97 12 93 41 80 | 12 80 36 41 53 1 50 18 19 75 3 40 39 16 83 85 66 73 35 70 97 25 56 67 93
|
||||||
|
Card 160: 86 47 9 35 3 85 33 53 99 50 | 44 55 12 43 86 13 20 31 3 37 33 28 9 41 98 39 35 58 19 29 25 1 82 67 71
|
||||||
|
Card 161: 68 93 52 43 62 15 66 33 53 84 | 27 44 37 39 50 71 63 94 20 79 62 38 42 72 12 33 85 9 43 93 83 68 28 47 45
|
||||||
|
Card 162: 54 43 38 6 50 80 72 41 78 92 | 92 73 55 15 34 61 79 57 72 71 53 83 50 41 47 60 10 58 67 36 69 2 63 84 5
|
||||||
|
Card 163: 58 52 14 99 77 51 70 16 35 57 | 60 51 34 86 92 66 10 93 99 16 67 27 47 19 35 61 58 4 9 28 82 84 42 38 43
|
||||||
|
Card 164: 9 19 34 3 38 46 74 85 42 87 | 68 71 70 98 63 84 10 59 16 76 91 18 36 4 60 77 97 80 64 88 95 66 94 58 37
|
||||||
|
Card 165: 46 68 72 82 41 79 28 6 19 23 | 88 74 16 36 44 19 46 63 85 77 94 38 42 28 21 26 70 66 1 51 9 45 49 20 6
|
||||||
|
Card 166: 94 97 38 52 45 84 81 71 49 22 | 86 66 45 40 21 58 6 82 29 87 38 68 20 96 95 49 4 77 25 36 32 51 18 94 48
|
||||||
|
Card 167: 47 98 46 63 38 23 57 61 31 96 | 63 44 68 56 67 26 27 7 10 93 79 50 4 48 42 9 19 5 23 11 47 52 40 88 58
|
||||||
|
Card 168: 36 59 73 99 8 49 63 19 34 74 | 24 30 98 46 65 95 91 14 7 37 87 57 40 67 16 94 66 93 12 82 48 28 88 90 58
|
||||||
|
Card 169: 34 48 11 54 74 40 13 71 86 76 | 7 65 66 23 95 45 27 42 47 60 20 92 28 84 50 73 2 80 41 99 77 62 17 21 85
|
||||||
|
Card 170: 67 6 17 58 51 2 19 72 33 41 | 34 20 46 35 29 89 12 77 37 97 88 4 98 44 82 39 38 15 32 48 63 65 68 21 93
|
||||||
|
Card 171: 63 1 50 71 14 33 78 85 40 99 | 40 32 54 69 4 93 85 1 99 50 71 78 57 22 63 5 14 38 33 72 16 24 29 64 13
|
||||||
|
Card 172: 33 52 35 85 57 49 60 11 80 43 | 39 92 94 83 49 81 82 79 97 5 72 33 87 80 63 52 96 53 1 43 35 60 85 57 11
|
||||||
|
Card 173: 33 40 92 88 97 77 20 84 27 23 | 58 33 12 27 34 92 46 23 13 62 77 82 43 54 40 64 37 96 15 84 60 88 20 97 1
|
||||||
|
Card 174: 4 6 66 57 77 24 59 50 9 46 | 63 57 2 60 4 89 88 46 24 14 5 66 16 59 11 13 64 39 38 92 65 44 77 17 79
|
||||||
|
Card 175: 55 82 61 80 67 89 90 93 43 1 | 7 3 84 23 14 69 47 35 57 10 95 99 64 63 42 93 96 6 53 72 29 33 18 56 83
|
||||||
|
Card 176: 70 7 30 29 66 82 8 24 89 11 | 9 67 86 87 22 76 50 51 40 21 6 98 94 17 12 74 33 34 55 20 53 99 1 80 52
|
||||||
|
Card 177: 78 14 51 53 26 44 36 2 33 23 | 53 26 48 24 5 88 33 90 36 22 29 89 51 45 70 44 23 2 73 91 57 92 78 47 14
|
||||||
|
Card 178: 19 75 43 85 35 45 93 59 57 7 | 57 32 12 45 76 59 71 85 74 46 69 25 86 10 50 44 79 95 93 49 63 24 82 33 73
|
||||||
|
Card 179: 35 18 9 3 88 62 83 98 61 41 | 41 70 64 48 31 61 45 46 15 99 69 51 98 28 87 17 30 26 24 52 29 71 60 38 66
|
||||||
|
Card 180: 13 20 97 73 94 22 80 40 47 85 | 41 30 22 11 65 87 69 23 58 27 59 57 96 55 82 20 79 76 85 3 89 13 8 25 94
|
||||||
|
Card 181: 14 74 36 86 59 49 69 24 65 28 | 93 24 57 83 34 62 80 85 74 36 23 9 13 45 52 67 64 26 15 69 95 21 43 38 77
|
||||||
|
Card 182: 41 88 35 24 7 6 11 79 8 56 | 25 78 66 69 64 44 95 81 85 48 87 26 47 63 56 3 94 86 8 52 24 73 15 20 19
|
||||||
|
Card 183: 2 35 46 34 76 99 12 47 33 64 | 15 53 32 21 73 11 7 26 75 95 37 17 67 56 77 99 39 72 82 47 2 64 20 33 55
|
||||||
|
Card 184: 73 43 57 65 99 86 29 32 69 53 | 4 19 89 82 48 94 18 53 17 64 45 85 26 52 97 43 47 1 41 90 65 72 46 20 31
|
||||||
|
Card 185: 81 71 51 68 27 22 63 76 85 3 | 84 20 91 48 47 98 13 30 83 64 93 26 50 78 66 77 9 97 32 12 90 41 74 52 43
|
||||||
|
Card 186: 76 27 92 85 62 60 75 11 65 70 | 48 51 58 99 40 52 50 10 95 1 46 21 67 78 86 36 55 14 84 28 12 18 8 42 53
|
||||||
|
Card 187: 88 55 79 69 45 73 16 21 5 11 | 95 24 32 59 96 37 87 7 28 89 33 82 35 60 83 20 43 75 57 80 1 9 52 31 36
|
||||||
|
Card 188: 61 32 89 34 13 46 66 42 22 91 | 74 52 2 85 82 57 8 41 26 6 10 38 95 64 90 79 3 60 98 76 45 94 51 70 28
|
38
2023/day4/part1.py
Normal file
38
2023/day4/part1.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
input_f = sys.argv[1]
|
||||||
|
arr = []
|
||||||
|
cards = []
|
||||||
|
|
||||||
|
result = 0
|
||||||
|
|
||||||
|
def calc_double(x):
|
||||||
|
tmp = 1
|
||||||
|
if len(x) <= 2:
|
||||||
|
return len(x)
|
||||||
|
for i in range(1,len(x)+1):
|
||||||
|
if i == 1:
|
||||||
|
tmp = 1
|
||||||
|
else:
|
||||||
|
tmp = tmp*2
|
||||||
|
return tmp
|
||||||
|
|
||||||
|
with open(input_f) as file:
|
||||||
|
for line in file:
|
||||||
|
tmp = line.replace(':','|').rstrip()
|
||||||
|
arr.append(tmp.split('|'))
|
||||||
|
|
||||||
|
for idx,i in enumerate(arr):
|
||||||
|
cards.append([])
|
||||||
|
for jdx,j in enumerate(i):
|
||||||
|
cards[idx].append(j.split())
|
||||||
|
|
||||||
|
for x in cards:
|
||||||
|
match = list(set(x[1]) & set(x[2]))
|
||||||
|
if len(match) != 0:
|
||||||
|
result = result + int(calc_double(match))
|
||||||
|
|
||||||
|
print(result)
|
38
2023/day4/part2.py
Normal file
38
2023/day4/part2.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
input_f = sys.argv[1]
|
||||||
|
arr = []
|
||||||
|
cards = []
|
||||||
|
|
||||||
|
result = 0
|
||||||
|
|
||||||
|
def calc_double(x):
|
||||||
|
tmp = 1
|
||||||
|
if len(x) <= 2:
|
||||||
|
return len(x)
|
||||||
|
for i in range(1,len(x)+1):
|
||||||
|
if i == 1:
|
||||||
|
tmp = 1
|
||||||
|
else:
|
||||||
|
tmp = tmp*2
|
||||||
|
return tmp
|
||||||
|
|
||||||
|
with open(input_f) as file:
|
||||||
|
for line in file:
|
||||||
|
tmp = line.replace(':','|').rstrip()
|
||||||
|
arr.append(tmp.split('|'))
|
||||||
|
|
||||||
|
for idx,i in enumerate(arr):
|
||||||
|
cards.append([])
|
||||||
|
for jdx,j in enumerate(i):
|
||||||
|
cards[idx].append(j.split())
|
||||||
|
|
||||||
|
for x in cards:
|
||||||
|
match = list(set(x[1]) & set(x[2]))
|
||||||
|
if len(match) != 0:
|
||||||
|
result = result + int(calc_double(match))
|
||||||
|
|
||||||
|
print(result)
|
6
2023/day4/test
Normal file
6
2023/day4/test
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
|
Loading…
Reference in New Issue
Block a user