advent_of_ruby 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/arb +1 -1
- data/data/solutions/reddit/ruby/2015/02.yml +5 -5
- data/data/solutions/reddit/ruby/2015/03.yml +6 -6
- data/data/solutions/reddit/ruby/2015/04.yml +7 -7
- data/data/solutions/reddit/ruby/2015/05.yml +6 -6
- data/data/solutions/reddit/ruby/2015/06.yml +14 -14
- data/data/solutions/reddit/ruby/2015/07.yml +15 -15
- data/data/solutions/reddit/ruby/2015/08.yml +6 -6
- data/data/solutions/reddit/ruby/2015/09.yml +11 -11
- data/data/solutions/reddit/ruby/2015/10.yml +18 -18
- data/data/solutions/reddit/ruby/2015/11.yml +19 -19
- data/data/solutions/reddit/ruby/2015/12.yml +10 -10
- data/data/solutions/reddit/ruby/2015/13.yml +9 -9
- data/data/solutions/reddit/ruby/2015/14.yml +11 -11
- data/data/solutions/reddit/ruby/2015/15.yml +9 -9
- data/data/solutions/reddit/ruby/2015/16.yml +7 -7
- data/data/solutions/reddit/ruby/2015/17.yml +10 -10
- data/data/solutions/reddit/ruby/2015/18.yml +4 -4
- data/data/solutions/reddit/ruby/2015/19.yml +1 -1
- data/data/solutions/reddit/ruby/2015/20.yml +2 -2
- data/data/solutions/reddit/ruby/2015/21.yml +4 -4
- data/data/solutions/reddit/ruby/2015/22.yml +5 -5
- data/data/solutions/reddit/ruby/2015/23.yml +3 -3
- data/data/solutions/reddit/ruby/2015/24.yml +11 -11
- data/data/solutions/reddit/ruby/2015/25.yml +5 -5
- data/data/solutions/reddit/ruby/2016/01.yml +5 -5
- data/data/solutions/reddit/ruby/2016/02.yml +3 -3
- data/data/solutions/reddit/ruby/2016/03.yml +1 -1
- data/data/solutions/reddit/ruby/2016/04.yml +4 -4
- data/data/solutions/reddit/ruby/2016/05.yml +3 -3
- data/data/solutions/reddit/ruby/2016/06.yml +4 -4
- data/data/solutions/reddit/ruby/2016/07.yml +3 -3
- data/data/solutions/reddit/ruby/2016/08.yml +6 -6
- data/data/solutions/reddit/ruby/2016/09.yml +1 -1
- data/data/solutions/reddit/ruby/2016/10.yml +3 -3
- data/data/solutions/reddit/ruby/2016/11.yml +1 -1
- data/data/solutions/reddit/ruby/2016/12.yml +3 -3
- data/data/solutions/reddit/ruby/2016/14.yml +4 -4
- data/data/solutions/reddit/ruby/2016/15.yml +11 -11
- data/data/solutions/reddit/ruby/2016/16.yml +1 -1
- data/data/solutions/reddit/ruby/2016/17.yml +3 -3
- data/data/solutions/reddit/ruby/2016/18.yml +3 -3
- data/data/solutions/reddit/ruby/2016/20.yml +2 -2
- data/data/solutions/reddit/ruby/2016/21.yml +7 -7
- data/data/solutions/reddit/ruby/2016/22.yml +10 -10
- data/data/solutions/reddit/ruby/2017/01.yml +7 -7
- data/data/solutions/reddit/ruby/2017/02.yml +15 -15
- data/data/solutions/reddit/ruby/2017/03.yml +9 -9
- data/data/solutions/reddit/ruby/2017/04.yml +4 -4
- data/data/solutions/reddit/ruby/2017/05.yml +12 -12
- data/data/solutions/reddit/ruby/2017/06.yml +16 -16
- data/data/solutions/reddit/ruby/2017/07.yml +5 -5
- data/data/solutions/reddit/ruby/2017/08.yml +18 -18
- data/data/solutions/reddit/ruby/2017/09.yml +7 -7
- data/data/solutions/reddit/ruby/2017/10.yml +9 -9
- data/data/solutions/reddit/ruby/2017/11.yml +1 -1
- data/data/solutions/reddit/ruby/2017/12.yml +6 -6
- data/data/solutions/reddit/ruby/2017/13.yml +6 -6
- data/data/solutions/reddit/ruby/2017/14.yml +1 -1
- data/data/solutions/reddit/ruby/2017/15.yml +3 -3
- data/data/solutions/reddit/ruby/2017/16.yml +5 -5
- data/data/solutions/reddit/ruby/2017/17.yml +6 -6
- data/data/solutions/reddit/ruby/2017/18.yml +7 -7
- data/data/solutions/reddit/ruby/2017/19.yml +2 -2
- data/data/solutions/reddit/ruby/2017/20.yml +5 -5
- data/data/solutions/reddit/ruby/2017/21.yml +11 -11
- data/data/solutions/reddit/ruby/2017/22.yml +1 -1
- data/data/solutions/reddit/ruby/2017/23.yml +1 -1
- data/data/solutions/reddit/ruby/2017/25.yml +3 -3
- data/data/solutions/reddit/ruby/2018/01.yml +20 -20
- data/data/solutions/reddit/ruby/2018/02.yml +16 -16
- data/data/solutions/reddit/ruby/2018/03.yml +12 -12
- data/data/solutions/reddit/ruby/2018/04.yml +6 -6
- data/data/solutions/reddit/ruby/2018/05.yml +15 -15
- data/data/solutions/reddit/ruby/2018/06.yml +4 -4
- data/data/solutions/reddit/ruby/2018/07.yml +11 -11
- data/data/solutions/reddit/ruby/2018/08.yml +9 -9
- data/data/solutions/reddit/ruby/2018/09.yml +13 -13
- data/data/solutions/reddit/ruby/2018/10.yml +10 -10
- data/data/solutions/reddit/ruby/2018/11.yml +9 -9
- data/data/solutions/reddit/ruby/2018/12.yml +2 -2
- data/data/solutions/reddit/ruby/2018/13.yml +14 -14
- data/data/solutions/reddit/ruby/2018/14.yml +5 -5
- data/data/solutions/reddit/ruby/2018/15.yml +2 -2
- data/data/solutions/reddit/ruby/2018/16.yml +7 -7
- data/data/solutions/reddit/ruby/2018/17.yml +1 -1
- data/data/solutions/reddit/ruby/2018/18.yml +6 -6
- data/data/solutions/reddit/ruby/2018/19.yml +1 -1
- data/data/solutions/reddit/ruby/2018/20.yml +1 -1
- data/data/solutions/reddit/ruby/2018/21.yml +4 -4
- data/data/solutions/reddit/ruby/2018/22.yml +3 -3
- data/data/solutions/reddit/ruby/2018/23.yml +11 -11
- data/data/solutions/reddit/ruby/2018/24.yml +4 -4
- data/data/solutions/reddit/ruby/2018/25.yml +6 -6
- data/data/solutions/reddit/ruby/2019/01.yml +11 -11
- data/data/solutions/reddit/ruby/2019/02.yml +13 -13
- data/data/solutions/reddit/ruby/2019/03.yml +7 -7
- data/data/solutions/reddit/ruby/2019/04.yml +11 -11
- data/data/solutions/reddit/ruby/2019/05.yml +10 -10
- data/data/solutions/reddit/ruby/2019/06.yml +7 -7
- data/data/solutions/reddit/ruby/2019/07.yml +8 -8
- data/data/solutions/reddit/ruby/2019/08.yml +8 -8
- data/data/solutions/reddit/ruby/2019/09.yml +4 -4
- data/data/solutions/reddit/ruby/2019/10.yml +4 -4
- data/data/solutions/reddit/ruby/2019/11.yml +7 -7
- data/data/solutions/reddit/ruby/2019/12.yml +17 -17
- data/data/solutions/reddit/ruby/2019/13.yml +6 -6
- data/data/solutions/reddit/ruby/2019/14.yml +2 -2
- data/data/solutions/reddit/ruby/2019/15.yml +3 -3
- data/data/solutions/reddit/ruby/2019/16.yml +6 -6
- data/data/solutions/reddit/ruby/2019/17.yml +3 -3
- data/data/solutions/reddit/ruby/2019/18.yml +1 -1
- data/data/solutions/reddit/ruby/2019/20.yml +9 -9
- data/data/solutions/reddit/ruby/2019/21.yml +3 -3
- data/data/solutions/reddit/ruby/2019/22.yml +3 -3
- data/data/solutions/reddit/ruby/2019/23.yml +1 -1
- data/data/solutions/reddit/ruby/2019/25.yml +2 -2
- data/data/solutions/reddit/ruby/2020/01.yml +30 -30
- data/data/solutions/reddit/ruby/2020/02.yml +25 -25
- data/data/solutions/reddit/ruby/2020/03.yml +17 -17
- data/data/solutions/reddit/ruby/2020/04.yml +26 -26
- data/data/solutions/reddit/ruby/2020/05.yml +35 -35
- data/data/solutions/reddit/ruby/2020/06.yml +40 -40
- data/data/solutions/reddit/ruby/2020/07.yml +16 -16
- data/data/solutions/reddit/ruby/2020/08.yml +13 -13
- data/data/solutions/reddit/ruby/2020/09.yml +21 -21
- data/data/solutions/reddit/ruby/2020/10.yml +29 -29
- data/data/solutions/reddit/ruby/2020/11.yml +8 -8
- data/data/solutions/reddit/ruby/2020/12.yml +22 -22
- data/data/solutions/reddit/ruby/2020/13.yml +15 -15
- data/data/solutions/reddit/ruby/2020/14.yml +11 -11
- data/data/solutions/reddit/ruby/2020/15.yml +9 -9
- data/data/solutions/reddit/ruby/2020/16.yml +13 -13
- data/data/solutions/reddit/ruby/2020/17.yml +11 -11
- data/data/solutions/reddit/ruby/2020/18.yml +19 -19
- data/data/solutions/reddit/ruby/2020/19.yml +18 -18
- data/data/solutions/reddit/ruby/2020/20.yml +4 -4
- data/data/solutions/reddit/ruby/2020/21.yml +4 -4
- data/data/solutions/reddit/ruby/2020/22.yml +8 -8
- data/data/solutions/reddit/ruby/2020/23.yml +4 -4
- data/data/solutions/reddit/ruby/2020/24.yml +6 -6
- data/data/solutions/reddit/ruby/2020/25.yml +6 -6
- data/data/solutions/reddit/ruby/2021/01.yml +74 -74
- data/data/solutions/reddit/ruby/2021/02.yml +45 -45
- data/data/solutions/reddit/ruby/2021/03.yml +43 -43
- data/data/solutions/reddit/ruby/2021/04.yml +23 -23
- data/data/solutions/reddit/ruby/2021/05.yml +16 -16
- data/data/solutions/reddit/ruby/2021/06.yml +35 -35
- data/data/solutions/reddit/ruby/2021/07.yml +26 -26
- data/data/solutions/reddit/ruby/2021/08.yml +15 -15
- data/data/solutions/reddit/ruby/2021/09.yml +11 -11
- data/data/solutions/reddit/ruby/2021/10.yml +9 -9
- data/data/solutions/reddit/ruby/2021/11.yml +12 -12
- data/data/solutions/reddit/ruby/2021/12.yml +8 -8
- data/data/solutions/reddit/ruby/2021/13.yml +13 -13
- data/data/solutions/reddit/ruby/2021/14.yml +10 -10
- data/data/solutions/reddit/ruby/2021/15.yml +10 -10
- data/data/solutions/reddit/ruby/2021/16.yml +8 -8
- data/data/solutions/reddit/ruby/2021/17.yml +6 -6
- data/data/solutions/reddit/ruby/2021/18.yml +5 -5
- data/data/solutions/reddit/ruby/2021/19.yml +3 -3
- data/data/solutions/reddit/ruby/2021/20.yml +5 -5
- data/data/solutions/reddit/ruby/2021/21.yml +5 -5
- data/data/solutions/reddit/ruby/2021/22.yml +4 -4
- data/data/solutions/reddit/ruby/2021/23.yml +7 -7
- data/data/solutions/reddit/ruby/2021/24.yml +8 -8
- data/data/solutions/reddit/ruby/2021/25.yml +4 -4
- data/data/solutions/reddit/ruby/2022/01.yml +29 -29
- data/data/solutions/reddit/ruby/2022/02.yml +21 -21
- data/data/solutions/reddit/ruby/2022/03.yml +35 -35
- data/data/solutions/reddit/ruby/2022/04.yml +42 -42
- data/data/solutions/reddit/ruby/2022/05.yml +29 -29
- data/data/solutions/reddit/ruby/2022/06.yml +38 -38
- data/data/solutions/reddit/ruby/2022/07.yml +25 -25
- data/data/solutions/reddit/ruby/2022/08.yml +9 -9
- data/data/solutions/reddit/ruby/2022/09.yml +18 -18
- data/data/solutions/reddit/ruby/2022/10.yml +14 -14
- data/data/solutions/reddit/ruby/2022/11.yml +7 -7
- data/data/solutions/reddit/ruby/2022/12.yml +2 -2
- data/data/solutions/reddit/ruby/2022/13.yml +9 -9
- data/data/solutions/reddit/ruby/2022/14.yml +5 -5
- data/data/solutions/reddit/ruby/2022/15.yml +6 -6
- data/data/solutions/reddit/ruby/2022/16.yml +5 -5
- data/data/solutions/reddit/ruby/2022/17.yml +2 -2
- data/data/solutions/reddit/ruby/2022/18.yml +6 -6
- data/data/solutions/reddit/ruby/2022/19.yml +3 -3
- data/data/solutions/reddit/ruby/2022/20.yml +12 -12
- data/data/solutions/reddit/ruby/2022/21.yml +11 -11
- data/data/solutions/reddit/ruby/2022/22.yml +4 -4
- data/data/solutions/reddit/ruby/2022/24.yml +10 -10
- data/data/solutions/reddit/ruby/2022/25.yml +10 -10
- data/data/solutions/reddit/ruby/2023/01.yml +52 -52
- data/data/solutions/reddit/ruby/2023/02.yml +21 -21
- data/data/solutions/reddit/ruby/2023/03.yml +18 -18
- data/data/solutions/reddit/ruby/2023/04.yml +31 -31
- data/data/solutions/reddit/ruby/2023/05.yml +14 -14
- data/data/solutions/reddit/ruby/2023/06.yml +24 -24
- data/data/solutions/reddit/ruby/2023/07.yml +32 -32
- data/data/solutions/reddit/ruby/2023/08.yml +20 -20
- data/data/solutions/reddit/ruby/2023/09.yml +32 -32
- data/data/solutions/reddit/ruby/2023/10.yml +18 -18
- data/data/solutions/reddit/ruby/2023/11.yml +16 -16
- data/data/solutions/reddit/ruby/2023/12.yml +5 -5
- data/data/solutions/reddit/ruby/2023/13.yml +6 -6
- data/data/solutions/reddit/ruby/2023/14.yml +14 -14
- data/data/solutions/reddit/ruby/2023/15.yml +13 -13
- data/data/solutions/reddit/ruby/2023/16.yml +8 -8
- data/data/solutions/reddit/ruby/2023/18.yml +5 -5
- data/data/solutions/reddit/ruby/2023/19.yml +6 -6
- data/data/solutions/reddit/ruby/2023/20.yml +9 -9
- data/data/solutions/reddit/ruby/2023/21.yml +5 -5
- data/data/solutions/reddit/ruby/2023/22.yml +2 -2
- data/data/solutions/reddit/ruby/2023/23.yml +1 -1
- data/data/solutions/reddit/ruby/2023/25.yml +1 -1
- data/data/solutions/reddit/ruby/2024/01.yml +15 -15
- data/data/solutions/reddit/ruby/2024/02.yml +17 -17
- data/data/solutions/reddit/ruby/2024/03.yml +43 -43
- data/data/solutions/reddit/ruby/2024/04.yml +18 -18
- data/data/solutions/reddit/ruby/2024/05.yml +29 -29
- data/data/solutions/reddit/ruby/2024/06.yml +19 -19
- data/data/solutions/reddit/ruby/2024/07.yml +26 -26
- data/data/solutions/reddit/ruby/2024/08.yml +15 -15
- data/data/solutions/reddit/ruby/2024/09.yml +5 -5
- data/data/solutions/reddit/ruby/2024/10.yml +9 -9
- data/data/solutions/reddit/ruby/2024/11.yml +15 -15
- data/data/solutions/reddit/ruby/2024/12.yml +9 -9
- data/data/solutions/reddit/ruby/2024/13.yml +10 -10
- data/data/solutions/reddit/ruby/2024/14.yml +6 -6
- data/data/solutions/reddit/ruby/2024/15.yml +5 -5
- data/data/solutions/reddit/ruby/2024/16.yml +4 -4
- data/data/solutions/reddit/ruby/2024/17.yml +11 -11
- data/data/solutions/reddit/ruby/2024/18.yml +9 -9
- data/data/solutions/reddit/ruby/2024/19.yml +16 -16
- data/data/solutions/reddit/ruby/2024/20.yml +8 -8
- data/data/solutions/reddit/ruby/2024/21.yml +3 -3
- data/data/solutions/reddit/ruby/2024/22.yml +8 -8
- data/data/solutions/reddit/ruby/2024/23.yml +13 -13
- data/data/solutions/reddit/ruby/2024/24.yml +7 -7
- data/data/solutions/reddit/ruby/2024/25.yml +14 -14
- data/lib/arb/api/aoc.rb +2 -2
- data/lib/arb/cli/run.rb +2 -3
- data/lib/arb/version.rb +1 -1
- data/lib/download_solutions/api/reddit/get_serial_comments.rb +1 -1
- metadata +2 -2
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: ericdykstra
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsxjs
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsxjs
|
4
4
|
:body: |-
|
5
5
|
Ruby solution using the new (as of 2.2.0) slice\_when enum method.
|
6
6
|
|
@@ -14,11 +14,11 @@
|
|
14
14
|
```
|
15
15
|
:replies:
|
16
16
|
- :author: tomb0y
|
17
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxttgxo
|
17
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxttgxo
|
18
18
|
:body: love the slice\_when! you could also use chars instead of split("") :)
|
19
19
|
:replies: []
|
20
20
|
- :author: tomb0y
|
21
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsvjq
|
21
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsvjq
|
22
22
|
:body: |-
|
23
23
|
Being on the leaderboard feels awesome :)
|
24
24
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
```
|
32
32
|
:replies: []
|
33
33
|
- :author: reacher
|
34
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsc40
|
34
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsc40
|
35
35
|
:body: |-
|
36
36
|
My Ruby solution. I finally made the leaderboard!
|
37
37
|
|
@@ -62,7 +62,7 @@
|
|
62
62
|
```
|
63
63
|
:replies: []
|
64
64
|
- :author: Axsuul
|
65
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsvn9
|
65
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtsvn9
|
66
66
|
:body: |-
|
67
67
|
Recursive Ruby solution
|
68
68
|
|
@@ -103,7 +103,7 @@
|
|
103
103
|
```
|
104
104
|
:replies:
|
105
105
|
- :author: Axsuul
|
106
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtt00p
|
106
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtt00p
|
107
107
|
:body: |-
|
108
108
|
I also like to write specs
|
109
109
|
|
@@ -128,7 +128,7 @@
|
|
128
128
|
```
|
129
129
|
:replies: []
|
130
130
|
- :author: gnuconsulting
|
131
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtthdu
|
131
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtthdu
|
132
132
|
:body: |-
|
133
133
|
My initial (braindead) copy finished the first part in a few seconds. The second run is still going, 15 minutes in. In fact, it took long enough for me to remember something vague about there being a difference in speed between various methods of string concatenation in ruby, look it up, copy my program, change two instances of += to \<\<, run the modified script, get the right answer, and finish the challenge.
|
134
134
|
|
@@ -169,19 +169,19 @@
|
|
169
169
|
I'll reply to this with the total time the first copy takes (if it ever finishes).
|
170
170
|
:replies:
|
171
171
|
- :author: gnuconsulting
|
172
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuvnr
|
172
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuvnr
|
173
173
|
:body: Almost exactly an hour! Vs. 5 seconds using \<\<
|
174
174
|
:replies: []
|
175
175
|
- :author: dalfgan
|
176
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuxzx
|
176
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuxzx
|
177
177
|
:body: 'ahah I did the same thing (but I used "#{x}#{y}"). After 2 or 3 min, I was like something is not correct. What about doing this in your code: final \<\< count.to\_s \<\< current'
|
178
178
|
:replies:
|
179
179
|
- :author: gnuconsulting
|
180
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtv7xw
|
180
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtv7xw
|
181
181
|
:body: No noticeable change. Still takes about 5.5 seconds for 50 iterations. I believe it's because it does the right-hand concat first (between `count.to_s` and `current`) which are both tiny strings, before appending the result onto `final` (the death-blow if you use `+=`).
|
182
182
|
:replies: []
|
183
183
|
- :author: segfaultvicta
|
184
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuu0n
|
184
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtuu0n
|
185
185
|
:body: |-
|
186
186
|
Golang - there's probably a slightly cleaner way to do this.
|
187
187
|
|
@@ -219,7 +219,7 @@
|
|
219
219
|
```
|
220
220
|
:replies:
|
221
221
|
- :author: metamatic
|
222
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwhtoh
|
222
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwhtoh
|
223
223
|
:body: |-
|
224
224
|
> Ruby or Perl would have made the solution obvious and a nice clean one-liner, I think, but honestly one of the reasons I'm doing these in golang is deliberately to run into these sort of issues
|
225
225
|
|
@@ -228,14 +228,14 @@
|
|
228
228
|
Anyhow, I guessed that speed was going to be an issue, so I checked and read that [byte buffers are the way to do character appends in Go](http://golang-examples.tumblr.com/post/86169510884/fastest-string-contatenation). I went that route and the code finishes in half a second. You might want to compare your code's speed with a byte buffer version?
|
229
229
|
:replies:
|
230
230
|
- :author: segfaultvicta
|
231
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwymqg
|
231
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwymqg
|
232
232
|
:body: |-
|
233
233
|
Huh, neat, thanks for the link! I think I will try that sometime and speed-compare just for funsies.
|
234
234
|
|
235
235
|
Writing to a byte buffer is definitely a lot cleaner-looking, to me, too, so.
|
236
236
|
:replies: []
|
237
237
|
- :author: "[deleted]"
|
238
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtw6vi
|
238
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxtw6vi
|
239
239
|
:body: |-
|
240
240
|
**Ruby solution**
|
241
241
|
|
@@ -269,7 +269,7 @@
|
|
269
269
|
```
|
270
270
|
:replies: []
|
271
271
|
- :author: tremendo
|
272
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxu2gu7
|
272
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxu2gu7
|
273
273
|
:body: |-
|
274
274
|
**Ruby**
|
275
275
|
|
@@ -307,7 +307,7 @@
|
|
307
307
|
```
|
308
308
|
:replies: []
|
309
309
|
- :author: vanderzee94
|
310
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxub4t6
|
310
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxub4t6
|
311
311
|
:body: |-
|
312
312
|
My solution in ruby
|
313
313
|
|
@@ -322,7 +322,7 @@
|
|
322
322
|
```
|
323
323
|
:replies: []
|
324
324
|
- :author: zacwaz
|
325
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxuxeku
|
325
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxuxeku
|
326
326
|
:body: |-
|
327
327
|
Simple, functional **Ruby** solution:
|
328
328
|
|
@@ -336,7 +336,7 @@
|
|
336
336
|
```
|
337
337
|
:replies: []
|
338
338
|
- :author: talkb1nary
|
339
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwr955
|
339
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w6h3m/day_10_solutions/cxwr955
|
340
340
|
:body: |-
|
341
341
|
Late to party, but i liked my result in Ruby
|
342
342
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: '0x0dea'
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv1vx5
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv1vx5
|
4
4
|
:body: |-
|
5
5
|
I finally "won" one! Thanks, Ruby.
|
6
6
|
|
@@ -12,27 +12,27 @@
|
|
12
12
|
```
|
13
13
|
:replies:
|
14
14
|
- :author: "[deleted]"
|
15
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv2ayw
|
15
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv2ayw
|
16
16
|
:body: "[deleted]"
|
17
17
|
:replies:
|
18
18
|
- :author: _jonah
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv38y5
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv38y5
|
20
20
|
:body: "`s.succ!` is doing more magic than the regexps."
|
21
21
|
:replies:
|
22
22
|
- :author: KrzaQ2
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv7ln7
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv7ln7
|
24
24
|
:body: Not that much, I used `(n.to_i(36)+1).to_s(36).gsub('0', 'a')` to get the next string.
|
25
25
|
:replies: []
|
26
26
|
- :author: gfixler
|
27
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv44uz
|
27
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv44uz
|
28
28
|
:body: What's scary is knowing that these things are probably in car braking systems and pacemakers.
|
29
29
|
:replies: []
|
30
30
|
- :author: _jonah
|
31
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv2ror
|
31
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv2ror
|
32
32
|
:body: This is beautiful. And TIL succ could be applied to str, and `!~` exists. And as long as we're golfing, you can shave off a bit by replacing your scan with `s =~ /(.)\1.*(.)\2/`
|
33
33
|
:replies: []
|
34
34
|
- :author: gareve
|
35
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv7uat
|
35
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv7uat
|
36
36
|
:body: |-
|
37
37
|
Nice, I've discovered Regexp.union :) Without that I was trying with:
|
38
38
|
|
@@ -41,11 +41,11 @@
|
|
41
41
|
```
|
42
42
|
:replies: []
|
43
43
|
- :author: takeitonben
|
44
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvp7z6
|
44
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvp7z6
|
45
45
|
:body: code like this is almost like magic to me.
|
46
46
|
:replies: []
|
47
47
|
- :author: crossbrowser
|
48
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvb4s5
|
48
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvb4s5
|
49
49
|
:body: |-
|
50
50
|
Doesn't this fail rule #3?
|
51
51
|
|
@@ -54,7 +54,7 @@
|
|
54
54
|
Or is `"aabaa"` valid?
|
55
55
|
:replies:
|
56
56
|
- :author: jmorais
|
57
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxveg1y
|
57
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxveg1y
|
58
58
|
:body: |-
|
59
59
|
None of my inputs had this problem. To solve just put a uniq.
|
60
60
|
|
@@ -69,11 +69,11 @@
|
|
69
69
|
```
|
70
70
|
:replies:
|
71
71
|
- :author: crossbrowser
|
72
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvetmy
|
72
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvetmy
|
73
73
|
:body: Nice, I was trying to do something similar but didn't know about scan. Useful.
|
74
74
|
:replies: []
|
75
75
|
- :author: segfaultvicta
|
76
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvcfqo
|
76
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvcfqo
|
77
77
|
:body: |-
|
78
78
|
> r = Regexp.union [\*?a..?z].each\_cons(3).map(&:join)
|
79
79
|
|
@@ -86,7 +86,7 @@
|
|
86
86
|
How long does this take to run, out of curiosity?
|
87
87
|
:replies: []
|
88
88
|
- :author: tremendo
|
89
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv34sv
|
89
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv34sv
|
90
90
|
:body: |-
|
91
91
|
**Ruby**
|
92
92
|
|
@@ -113,15 +113,15 @@
|
|
113
113
|
```
|
114
114
|
:replies:
|
115
115
|
- :author: "[deleted]"
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv79ev
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv79ev
|
117
117
|
:body: "[deleted]"
|
118
118
|
:replies:
|
119
119
|
- :author: tremendo
|
120
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvajgu
|
120
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvajgu
|
121
121
|
:body: Indeed! thanks for that.
|
122
122
|
:replies: []
|
123
123
|
- :author: gnuconsulting
|
124
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv3oyr
|
124
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv3oyr
|
125
125
|
:body: |-
|
126
126
|
Ruby's .next operator for strings made this really easy. As per usual, I know my regex is bad and should feel bad, but I don't care. Also, I gotta stop with the social life - second night in a row that it cost me a spot on the board.
|
127
127
|
|
@@ -144,14 +144,14 @@
|
|
144
144
|
```
|
145
145
|
:replies:
|
146
146
|
- :author: topaz2078
|
147
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv5hua
|
147
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv5hua
|
148
148
|
:body: |-
|
149
149
|
DISREGARD SOCIALIZING
|
150
150
|
|
151
151
|
ACQUIRE STARS
|
152
152
|
:replies: []
|
153
153
|
- :author: amnn9
|
154
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv77ns
|
154
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxv77ns
|
155
155
|
:body: |-
|
156
156
|
**Ruby**
|
157
157
|
|
@@ -178,7 +178,7 @@
|
|
178
178
|
My Haskell side yearned for an _iterate_ function, so that's what drove this implementation.
|
179
179
|
:replies: []
|
180
180
|
- :author: beefamaka
|
181
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvqlz7
|
181
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wbzyv/day_11_solutions/cxvqlz7
|
182
182
|
:body: |-
|
183
183
|
here's my solution in F#. Feeling jealous of the Ruby 'succ' function so I tried to create my own.
|
184
184
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: gareve
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw7q3o
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw7q3o
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
@@ -21,7 +21,7 @@
|
|
21
21
|
For part 1 I just did the regex /(-)\*\d+/ on my editor and copied the values on a spreadsheet xD. The funny part is that this regex it fails with strings like "asd123def"
|
22
22
|
:replies: []
|
23
23
|
- :author: Axsuul
|
24
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw7uw8
|
24
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw7uw8
|
25
25
|
:body: |-
|
26
26
|
Ruby recursive solution
|
27
27
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
```
|
53
53
|
:replies: []
|
54
54
|
- :author: tremendo
|
55
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw8sxq
|
55
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxw8sxq
|
56
56
|
:body: |-
|
57
57
|
Here's mine. Another **Ruby** one:
|
58
58
|
|
@@ -79,7 +79,7 @@
|
|
79
79
|
```
|
80
80
|
:replies:
|
81
81
|
- :author: tremendo
|
82
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwj2t0
|
82
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwj2t0
|
83
83
|
:body: |-
|
84
84
|
Looking at it a few hours later, bored, felt the need to compact it a little bit:
|
85
85
|
|
@@ -99,7 +99,7 @@
|
|
99
99
|
```
|
100
100
|
:replies: []
|
101
101
|
- :author: gnuconsulting
|
102
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxway30
|
102
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxway30
|
103
103
|
:body: |-
|
104
104
|
Day 3 of not being home at 9. It's starting to kill me a little (on the inside). But that's ok, a bug in my part 2 logic would have easily cost me a place on the leaderboard anyway. I did the 'smart' thing and parsed the JSON for part 1 so the bones were all there for part 2. And like most people, this just cried out for recursion.
|
105
105
|
|
@@ -200,11 +200,11 @@
|
|
200
200
|
```
|
201
201
|
:replies:
|
202
202
|
- :author: topaz2078
|
203
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwcgcz
|
203
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwcgcz
|
204
204
|
:body: You could have put the `"red"` check at the top of traverseHash instead of before calling traverseHash everywhere.
|
205
205
|
:replies: []
|
206
206
|
- :author: phpaoc
|
207
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwcgn1
|
207
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwcgn1
|
208
208
|
:body: |-
|
209
209
|
Part1, Ruby, golfed:
|
210
210
|
|
@@ -215,7 +215,7 @@
|
|
215
215
|
_You will not encounter any strings containing numbers._ clearly was an invitation for not actually parsing JSON.
|
216
216
|
:replies: []
|
217
217
|
- :author: rkachowski
|
218
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwpauu
|
218
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwpauu
|
219
219
|
:body: |-
|
220
220
|
ruby, not too happy with it..
|
221
221
|
|
@@ -275,7 +275,7 @@
|
|
275
275
|
but i eventually discovered that when using more than one block param in the call to `Array#each` results in pattern matching kicking in and you lose elements that don't have an appropriate variable to map to... yuk
|
276
276
|
:replies: []
|
277
277
|
- :author: aprosepro
|
278
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwpi3y
|
278
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwpi3y
|
279
279
|
:body: |-
|
280
280
|
part 2 in ruby, i enjoyed this one. of course, like others said... i saw part 1 and thought the entire challenge would be a cakewalk. total re-write from my single line regex for part 1.
|
281
281
|
|
@@ -296,7 +296,7 @@
|
|
296
296
|
```
|
297
297
|
:replies: []
|
298
298
|
- :author: jchook
|
299
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwqecp
|
299
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wh73d/day_12_solutions/cxwqecp
|
300
300
|
:body: |-
|
301
301
|
Ruby, golfed slightly
|
302
302
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
---
|
2
2
|
- :author: SomebodyTookMyHandle
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxx8buz
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxx8buz
|
4
4
|
:body: 'Brute forced it in Ruby, very similar to how I solved #9 (construct graph, find permutations with built-in method, profit). Basically the only difference is that this graph is directed whereas day #9 was undirected. Missed the leaderboard by a minute due to a variety of comedic errors and misreading the submission instructions for Part Two.'
|
5
5
|
:replies:
|
6
6
|
- :author: ThereOnceWasAMan
|
7
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxyqpfn
|
7
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxyqpfn
|
8
8
|
:body: 'This is undirected too, since relationships are always reciprocal. Just save "A''s change sitting next to B + B''s change sitting next to A", and consider that "distance from A to B". Then it''s equivalent to #9 -- the only difference is that it''s a true TSP, since you end up back where you started, whereas #9 you never complete the last leg of the TSP.'
|
9
9
|
:replies: []
|
10
10
|
- :author: "[deleted]"
|
11
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxbvmo
|
11
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxbvmo
|
12
12
|
:body: |-
|
13
13
|
Brute force Ruby solution:
|
14
14
|
|
@@ -71,15 +71,15 @@
|
|
71
71
|
```
|
72
72
|
:replies:
|
73
73
|
- :author: Herathe
|
74
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxdt68
|
74
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxdt68
|
75
75
|
:body: 'Hey just a quick pointer: You can use the constant -Float::INFINITY instead of -9999999. That way any value is guaranteed to be larger than maximum'
|
76
76
|
:replies:
|
77
77
|
- :author: "[deleted]"
|
78
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxlwks
|
78
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxlwks
|
79
79
|
:body: Thanks for the tip!!! :) I've just started with Ruby and was doing this quick and dirty, and didn't take the time to find out what the Math.MAX\_INT equivalent was....
|
80
80
|
:replies: []
|
81
81
|
- :author: SomebodyTookMyHandle
|
82
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxyejbd
|
82
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxyejbd
|
83
83
|
:body: |-
|
84
84
|
By the way, there's a quick and dirty way to write this:
|
85
85
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
Sacrifices a bit of clarity though.
|
89
89
|
:replies: []
|
90
90
|
- :author: phpaoc
|
91
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxd775
|
91
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxd775
|
92
92
|
:body: |-
|
93
93
|
Ruby:
|
94
94
|
|
@@ -113,7 +113,7 @@
|
|
113
113
|
```
|
114
114
|
:replies: []
|
115
115
|
- :author: rkachowski
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxe2wk
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxe2wk
|
117
117
|
:body: |-
|
118
118
|
ruby, again v similar to #9
|
119
119
|
|
@@ -153,7 +153,7 @@
|
|
153
153
|
whenever i come here i always feel like everyone else has already managed to solve this both faster, and with only 0.2 lines of code
|
154
154
|
:replies: []
|
155
155
|
- :author: JurgenKesker
|
156
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxgndr
|
156
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wm0oy/day_13_solutions/cxxgndr
|
157
157
|
:body: |-
|
158
158
|
Ruby
|
159
159
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: SomebodyTookMyHandle
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxydtvs
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxydtvs
|
4
4
|
:body: |-
|
5
5
|
I also tackled it in Ruby using a class-based approach. A bit sloppy, but, hey, it's not only the reindeer who are racing!
|
6
6
|
|
@@ -72,7 +72,7 @@
|
|
72
72
|
```
|
73
73
|
:replies:
|
74
74
|
- :author: JurgenKesker
|
75
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxytybj
|
75
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxytybj
|
76
76
|
:body: |-
|
77
77
|
Nice, I have almost the same approach. Only I see you use .max\_by. I will look that one up, didn't know that one.
|
78
78
|
|
@@ -81,11 +81,11 @@
|
|
81
81
|
-- I had a look at max\_by, but it seems to return only 1 leader. What if there are multiple leaders? Your code doesn't seem to handle that.
|
82
82
|
:replies:
|
83
83
|
- :author: SomebodyTookMyHandle
|
84
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cy0flil
|
84
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cy0flil
|
85
85
|
:body: That's a very good point. I guess I lucked out in that the leader was the first position in the array so that that reindeer received all the ties.
|
86
86
|
:replies: []
|
87
87
|
- :author: Axsuul
|
88
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxye2lc
|
88
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxye2lc
|
89
89
|
:body: |-
|
90
90
|
Ruby (State machine)
|
91
91
|
|
@@ -158,7 +158,7 @@
|
|
158
158
|
```
|
159
159
|
:replies: []
|
160
160
|
- :author: jchook
|
161
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyeaqr
|
161
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyeaqr
|
162
162
|
:body: |-
|
163
163
|
**Ruby**
|
164
164
|
|
@@ -197,7 +197,7 @@
|
|
197
197
|
```
|
198
198
|
:replies: []
|
199
199
|
- :author: gnuconsulting
|
200
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyef06
|
200
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyef06
|
201
201
|
:body: |-
|
202
202
|
Well out of the leaderboard today - part 2 kicked my butt. I feel like I can - more and more - see the seams between my ever-so-slightly-more-than-shell-scripts and "real" programs.
|
203
203
|
|
@@ -290,7 +290,7 @@
|
|
290
290
|
```
|
291
291
|
:replies: []
|
292
292
|
- :author: rkachowski
|
293
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyiyjk
|
293
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyiyjk
|
294
294
|
:body: |-
|
295
295
|
ruby
|
296
296
|
|
@@ -337,7 +337,7 @@
|
|
337
337
|
i screwed myself by forgetting that **each** winning reindeer gets a point
|
338
338
|
:replies: []
|
339
339
|
- :author: JurgenKesker
|
340
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxytkcc
|
340
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxytkcc
|
341
341
|
:body: |-
|
342
342
|
Ruby part 1 & 2
|
343
343
|
|
@@ -412,11 +412,11 @@
|
|
412
412
|
```
|
413
413
|
:replies: []
|
414
414
|
- :author: HorizonShadow
|
415
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyxwec
|
415
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxyxwec
|
416
416
|
:body: Ruby - https://github.com/HorizonShadow/Advent-of-Code/tree/master/day14
|
417
417
|
:replies: []
|
418
418
|
- :author: "[deleted]"
|
419
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxz2qac
|
419
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cxz2qac
|
420
420
|
:body: |-
|
421
421
|
Ruby solution:
|
422
422
|
|
@@ -496,7 +496,7 @@
|
|
496
496
|
```
|
497
497
|
:replies: []
|
498
498
|
- :author: zacwaz
|
499
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cy1snmd
|
499
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wqtx2/day_14_solutions/cy1snmd
|
500
500
|
:body: |-
|
501
501
|
Ruby:
|
502
502
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
---
|
2
2
|
- :author: lannonbr
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzhu3m
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzhu3m
|
4
4
|
:body: 'It seems that everyone was going brute force for this problem. I would be interested to see one that wasn''t. Anyway here''s my solution in Ruby: [day15.rb](https://github.com/lannonbr/AdventOfCode/blob/master/day15/day15.rb)'
|
5
5
|
:replies:
|
6
6
|
- :author: r_sreeram
|
7
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzl0u2
|
7
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzl0u2
|
8
8
|
:body: |-
|
9
9
|
> everyone was going brute force for this problem. I would be interested to see one that wasn't.
|
10
10
|
|
11
11
|
https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzkxzn
|
12
12
|
:replies: []
|
13
13
|
- :author: "[deleted]"
|
14
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzit7z
|
14
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzit7z
|
15
15
|
:body: |-
|
16
16
|
Finally made the leaderboard!!!! :)
|
17
17
|
|
@@ -71,7 +71,7 @@
|
|
71
71
|
```
|
72
72
|
:replies: []
|
73
73
|
- :author: ericdykstra
|
74
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzkgnc
|
74
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzkgnc
|
75
75
|
:body: |-
|
76
76
|
Non-brute-forced solution to the first half in Ruby. Since I figured a greedy algorithm would work right out the gate, I decided to write that instead of brute-force. It's not pretty, and I had to switch to a brute-force method to get #90 on the leaderboard for part 2, but here it is.
|
77
77
|
|
@@ -112,7 +112,7 @@
|
|
112
112
|
```
|
113
113
|
:replies: []
|
114
114
|
- :author: JurgenKesker
|
115
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzrq92
|
115
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzrq92
|
116
116
|
:body: |-
|
117
117
|
Ruby, part 2. Couldn't find a way to dynamically generate the combinations, so went for a hardcoded nested for loop.
|
118
118
|
|
@@ -253,7 +253,7 @@
|
|
253
253
|
```
|
254
254
|
:replies: []
|
255
255
|
- :author: Phakx
|
256
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzszqn
|
256
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzszqn
|
257
257
|
:body: |-
|
258
258
|
Solution in **Ruby** after some iterations...
|
259
259
|
|
@@ -349,11 +349,11 @@
|
|
349
349
|
```
|
350
350
|
:replies:
|
351
351
|
- :author: JurgenKesker
|
352
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzyqtc
|
352
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxzyqtc
|
353
353
|
:body: Nice use of `repeated_combination`. Didn't know that one.
|
354
354
|
:replies: []
|
355
355
|
- :author: razr_69
|
356
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxztug8
|
356
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cxztug8
|
357
357
|
:body: |-
|
358
358
|
My solution in Ruby.
|
359
359
|
|
@@ -421,7 +421,7 @@
|
|
421
421
|
Appreciate your feedback on the solution :)
|
422
422
|
:replies: []
|
423
423
|
- :author: Herathe
|
424
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cy26spt
|
424
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3wwj84/day_15_solutions/cy26spt
|
425
425
|
:body: |-
|
426
426
|
Ruby part 1 using repeated\_combination
|
427
427
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: gareve
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0xp4y
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0xp4y
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
```
|
25
25
|
:replies: []
|
26
26
|
- :author: jchook
|
27
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy1l6if
|
27
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy1l6if
|
28
28
|
:body: |-
|
29
29
|
**Ruby**
|
30
30
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
```
|
39
39
|
:replies: []
|
40
40
|
- :author: SnacksOnAPlane
|
41
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0pkb5
|
41
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0pkb5
|
42
42
|
:body: |-
|
43
43
|
**Ruby**
|
44
44
|
|
@@ -85,7 +85,7 @@
|
|
85
85
|
```
|
86
86
|
:replies: []
|
87
87
|
- :author: _jonah
|
88
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0qr2l
|
88
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0qr2l
|
89
89
|
:body: |-
|
90
90
|
ruby:
|
91
91
|
|
@@ -111,7 +111,7 @@
|
|
111
111
|
```
|
112
112
|
:replies: []
|
113
113
|
- :author: Phakx
|
114
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0w2ui
|
114
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy0w2ui
|
115
115
|
:body: |-
|
116
116
|
pretty expressive solution in **Ruby** :
|
117
117
|
|
@@ -273,7 +273,7 @@
|
|
273
273
|
```
|
274
274
|
:replies: []
|
275
275
|
- :author: rkachowski
|
276
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy1cjw7
|
276
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy1cjw7
|
277
277
|
:body: |-
|
278
278
|
ruby! i could probably have cut this down if i wasn't so goddamn determined to copy paste
|
279
279
|
|
@@ -334,7 +334,7 @@
|
|
334
334
|
```
|
335
335
|
:replies: []
|
336
336
|
- :author: Herathe
|
337
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy28o92
|
337
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3x1i26/day_16_solutions/cy28o92
|
338
338
|
:body: |-
|
339
339
|
**Ruby part 1** https://github.com/herathe/advent-of-code/blob/master/16-1.rb
|
340
340
|
|