Compare commits

...

2 Commits

Author SHA1 Message Date
Jeff Yates e60e40ccb2 solved part 1 2020-12-10 08:46:43 -05:00
Jeff Yates 2e6214919d added input 2020-12-10 07:54:12 -05:00
4 changed files with 151 additions and 0 deletions

98
day10/input Normal file
View File

@ -0,0 +1,98 @@
118
14
98
154
71
127
38
50
36
132
66
121
65
26
119
46
2
140
95
133
15
40
32
137
45
155
156
97
145
44
153
96
104
58
149
75
72
57
76
56
143
11
138
37
9
82
62
17
88
33
5
10
134
114
23
111
81
21
103
126
18
8
43
108
120
16
146
110
144
124
67
79
59
89
87
131
80
139
31
115
107
53
68
130
101
22
125
83
92
30
39
102
47
109
152
1
29
86

31
day10/input.sample Normal file
View File

@ -0,0 +1,31 @@
28
33
18
42
31
14
46
20
48
47
24
23
49
45
19
38
39
11
1
32
25
35
8
17
7
9
4
2
34
10
3

11
day10/input.small Normal file
View File

@ -0,0 +1,11 @@
16
10
15
5
1
11
7
19
6
12
4

11
day10/solution1.rb Executable file
View File

@ -0,0 +1,11 @@
#!/bin/env ruby
require 'pry'
numbers = File.read('./input').split("\n").map(&:to_i).sort
solution = numbers.map.with_index do |num, i|
next if i == 0
num - numbers[i-1]
end
#binding.pry
final = [solution.count(1)+1, solution.count(3)+1]
pp final, final.reduce(&:*)