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: Lower_Ambition_2147
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kdgo9b2
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kdgo9b2
|
4
4
|
:body: |-
|
5
5
|
Learning refactoring with this year's Advent of Code. Check commits to see the steps!
|
6
6
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
Whole solution with history of refactorings as commits: https://github.com/takiarek/advent_of_code_2023_day_3/tree/day_3
|
10
10
|
:replies: []
|
11
11
|
- :author: Best_Pirate_69
|
12
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kc9o9dh
|
12
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kc9o9dh
|
13
13
|
:body: |-
|
14
14
|
Regex and Ruby rock!
|
15
15
|
|
@@ -65,7 +65,7 @@
|
|
65
65
|
```
|
66
66
|
:replies: []
|
67
67
|
- :author: Annual-Management613
|
68
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsgfkh
|
68
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsgfkh
|
69
69
|
:body: |-
|
70
70
|
```ruby
|
71
71
|
# frozen_string_literal: true
|
@@ -126,7 +126,7 @@
|
|
126
126
|
```
|
127
127
|
:replies: []
|
128
128
|
- :author: SleepingInsomniac
|
129
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kburlwr
|
129
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kburlwr
|
130
130
|
:body: |-
|
131
131
|
Part 1:
|
132
132
|
|
@@ -310,7 +310,7 @@
|
|
310
310
|
```
|
311
311
|
:replies: []
|
312
312
|
- :author: Potential-Series-105
|
313
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbzj4v8
|
313
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbzj4v8
|
314
314
|
:body: |-
|
315
315
|
part 1. 195 bytes.
|
316
316
|
|
@@ -325,7 +325,7 @@
|
|
325
325
|
```
|
326
326
|
:replies: []
|
327
327
|
- :author: JelloRough
|
328
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbs9nvp
|
328
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbs9nvp
|
329
329
|
:body: |-
|
330
330
|
I did two different approaches on each part. I missed to see how to adapt part 1 to get part 2 as most of the solutions I have seen. Adding a map when a \* was found.
|
331
331
|
|
@@ -334,25 +334,25 @@
|
|
334
334
|
[day3.rb](https://github.com/hugomosh/adventura-de-codigo/blob/sandbox/2023/day3.rb)
|
335
335
|
:replies: []
|
336
336
|
- :author: HAEC_EST_SPARTA
|
337
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsca0p
|
337
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsca0p
|
338
338
|
:body: |-
|
339
339
|
##### [Solution on sourcehut](https://git.sr.ht/%7Eawsmith/advent-of-code/tree/2023-ruby/item/lib/day03.rb)
|
340
340
|
|
341
341
|
This was a pretty neat problem: I certainly wasn't expecting to be reaching for the `Matrix` module already on Day 3, but it ended up working quite well to model the grid. I unfortunately lost quite a bit of time to some faulty deduplication logic on Part 1 (the uniqueness constraint should be value, column, _and row_!), but Part 2 was trivial thereafter.
|
342
342
|
:replies:
|
343
343
|
- :author: PassifloraCaerulea
|
344
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsf7je
|
344
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsf7je
|
345
345
|
:body: Interesting. More structured than my Ruby code since I decided that an array of strings was _perfectly cromulent_ for treating as a two-dimensional data structure :D I've not kept up with the latest Ruby stuff either!
|
346
346
|
:replies: []
|
347
347
|
- :author: cwby_bbop
|
348
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsid0t
|
348
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsid0t
|
349
349
|
:body: |-
|
350
350
|
Edge cases will always get you lol
|
351
351
|
|
352
352
|
[https://github.com/ealvar3z/aoc-2023/blob/master/day03.rb](https://github.com/ealvar3z/aoc-2023/blob/master/day03.rb)
|
353
353
|
:replies: []
|
354
354
|
- :author: glebm
|
355
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsittp
|
355
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsittp
|
356
356
|
:body: |-
|
357
357
|
Part 1:
|
358
358
|
|
@@ -424,7 +424,7 @@
|
|
424
424
|
```
|
425
425
|
:replies: []
|
426
426
|
- :author: 6f937f00-3166-11e4-8
|
427
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbvctzx
|
427
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbvctzx
|
428
428
|
:body: |-
|
429
429
|
```ruby
|
430
430
|
require 'set'
|
@@ -499,7 +499,7 @@
|
|
499
499
|
```
|
500
500
|
:replies: []
|
501
501
|
- :author: Sharparam
|
502
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbs8gke
|
502
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbs8gke
|
503
503
|
:body: |-
|
504
504
|
Too long to paste today: https://github.com/Sharparam/advent-of-code/blob/main/src/2023/03/solve.rb
|
505
505
|
|
@@ -508,7 +508,7 @@
|
|
508
508
|
The big one was that \>!I didn't clear my "number buffer" when a symbol happened directly between two numbers on a line, so `123*456` on a line would be parsed as the single number `123456`!\<.
|
509
509
|
:replies: []
|
510
510
|
- :author: PassifloraCaerulea
|
511
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsdpcp
|
511
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsdpcp
|
512
512
|
:body: |-
|
513
513
|
[Part 1](https://topaz.github.io/paste/#XQAAAQBzBAAAAAAAAAA2GkofDKPu58w0EHSiMBIPN58ENYxIxejQDv6proEW4TnDiEStYttJDmsfdts1SPJTgrn1Yy2FoQ5yqiZ879eZsad0KfFmufusabgOJvYtEIio2trRduiAfDurOicYk5UU12aM1ar4Ox9sLAOiyrQhp+bGXsIcbhzgAqOdfdTYGZkw3MUQ3anL4nbGMc91pm3MMs4FPc0QHzsv+9KQoO6VxE5e4VvzU/wH/8HvIbsyPrvAQdwnYNK1LmymhFxd9Cln56W6WEBU9UdTHsZjtPfeWf2GvtM2bYyPFLdkC7jl+huxEzXipEvG7TRficTul7CEUk63gYBUQFhWCwXXoYg/FkEDUXaUuPpKn86FBcLGyFmnXazCsxA1rOsf/w0s86ycx5PzSTY/SqWyevzu7gfko1EqXZSnstejIZtOp+WigJT3fzobiu+5OqnlPyebbFLxR7EH2raULX9JUVfp/lUOiJNasOtAQytC8Jtmq8h3qMMS9W7/Fn5TYlkRmkSxCjXpAmy2/40/2wJUMTlGJsJvEENDMHVppaWAoJXC02NrPlSQIGmbB8JCuh6zWhvuFfaoFUbsk3Mqn+z16dRMFPNQvdxpG2Q6Vbz//+NQ28Y=)
|
514
514
|
|
@@ -519,28 +519,28 @@
|
|
519
519
|
Because I'm an inveterate polyglot I had to switch languages halfway through since today was pretty comfortable for C. Fun excuse to use that wierdo string function `strpbrk`.
|
520
520
|
:replies: []
|
521
521
|
- :author: snowe2010
|
522
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsf3cu
|
522
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsf3cu
|
523
523
|
:body: |-
|
524
524
|
really struggled today.
|
525
525
|
|
526
526
|
https://github.com/snowe2010/advent-of-code/blob/master/ruby\_aoc/2023/day03/day03.rb
|
527
527
|
:replies: []
|
528
528
|
- :author: vinc686
|
529
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsq0ib
|
529
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbsq0ib
|
530
530
|
:body: |-
|
531
531
|
My code is ugly :(
|
532
532
|
|
533
533
|
https://github.com/vinc/advent-of-code/tree/master/ruby/2023/03
|
534
534
|
:replies: []
|
535
535
|
- :author: Chemical-Mixture1942
|
536
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbt7my5
|
536
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbt7my5
|
537
537
|
:body: |-
|
538
538
|
[https://github.com/mathexresources/adventOfCode2023/tree/main/day3](https://github.com/mathexresources/adventOfCode2023/tree/main/day3)
|
539
539
|
|
540
540
|
My code is quite big so i figured ill just paste the github repo link, both parts done, feel free to take a look or mention my mistakes and opportunities to improve the code.
|
541
541
|
:replies: []
|
542
542
|
- :author: RelativeLead5
|
543
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbtqifk
|
543
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbtqifk
|
544
544
|
:body: |-
|
545
545
|
PART 1
|
546
546
|
|
@@ -609,7 +609,7 @@
|
|
609
609
|
```
|
610
610
|
:replies: []
|
611
611
|
- :author: careyi4
|
612
|
-
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbttcry
|
612
|
+
:url: https://www.reddit.com/r/adventofcode/comments/189m3qw/2023_day_3_solutions/kbttcry
|
613
613
|
:body: |-
|
614
614
|
Damn, maybe Sunday morning brain, but didn't expect that to be that hard!
|
615
615
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: dafarmerz
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kca5hsi
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kca5hsi
|
4
4
|
:body: |-
|
5
5
|
Part 1
|
6
6
|
|
@@ -21,7 +21,7 @@
|
|
21
21
|
p check\_winners('cards.txt')
|
22
22
|
:replies: []
|
23
23
|
- :author: Potential-Series-105
|
24
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzlfo6
|
24
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzlfo6
|
25
25
|
:body: |-
|
26
26
|
66 bytes seem to be enough for part 1
|
27
27
|
|
@@ -30,15 +30,15 @@
|
|
30
30
|
```
|
31
31
|
:replies:
|
32
32
|
- :author: Potential-Series-105
|
33
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzmwg3
|
33
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzmwg3
|
34
34
|
:body: Thanks to /u/erikade this can be shortened even further to 57 bytes. look at his comment for the magic.
|
35
35
|
:replies: []
|
36
36
|
- :author: erikade
|
37
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzou5t
|
37
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzou5t
|
38
38
|
:body: Oh wow! Congrats on this beautiful solution, AoC is so much fun!
|
39
39
|
:replies: []
|
40
40
|
- :author: coderhs
|
41
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx9i7w
|
41
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx9i7w
|
42
42
|
:body: |-
|
43
43
|
Part 1
|
44
44
|
|
@@ -69,14 +69,14 @@
|
|
69
69
|
```
|
70
70
|
:replies:
|
71
71
|
- :author: cwby_bbop
|
72
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxb143
|
72
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxb143
|
73
73
|
:body: |-
|
74
74
|
The process is there, but your approach is making tons of transformation before storing it all in `f`.
|
75
75
|
|
76
76
|
Here was my approach for today: [https://www.reddit.com/r/adventofcode/comments/18actmy/comment/kbx8do6/?utm\_source=share&utm\_medium=web2x&context=3](https://www.reddit.com/r/adventofcode/comments/18actmy/comment/kbx8do6/?utm_source=share&utm_medium=web2x&context=3)
|
77
77
|
:replies:
|
78
78
|
- :author: coderhs
|
79
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxbwl7
|
79
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxbwl7
|
80
80
|
:body: |-
|
81
81
|
Ya, its on purpose, I am trying to do as much as I can i one line. (running it in IRB)
|
82
82
|
|
@@ -89,7 +89,7 @@
|
|
89
89
|
That is a better approach to break down the string.
|
90
90
|
:replies: []
|
91
91
|
- :author: Symbroson
|
92
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhn9f
|
92
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhn9f
|
93
93
|
:body: |-
|
94
94
|
almost golfed. how can I compress this further?There has to be a way to generate the cnt array in one line!
|
95
95
|
|
@@ -105,7 +105,7 @@
|
|
105
105
|
```
|
106
106
|
:replies:
|
107
107
|
- :author: riffraff
|
108
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxk858
|
108
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxk858
|
109
109
|
:body: |-
|
110
110
|
line 2 can be
|
111
111
|
|
@@ -122,7 +122,7 @@
|
|
122
122
|
```
|
123
123
|
:replies:
|
124
124
|
- :author: Symbroson
|
125
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxrntu
|
125
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxrntu
|
126
126
|
:body: |-
|
127
127
|
golfing this I can get this down to 202 bytes. Removed the bounds check and w-[0] for pow -1 elimination as well
|
128
128
|
|
@@ -136,7 +136,7 @@
|
|
136
136
|
```
|
137
137
|
:replies:
|
138
138
|
- :author: riffraff
|
139
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbyz4q8
|
139
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbyz4q8
|
140
140
|
:body: |-
|
141
141
|
yeah using `$<.map` instead of `File.readlines('input.txt')` would make this quite a few characters less :)
|
142
142
|
|
@@ -145,18 +145,18 @@
|
|
145
145
|
But yeah, the count array initialization is annoying! I _think_ you could do something nasty with `inject` but ATM I can't see it being shorter.
|
146
146
|
:replies: []
|
147
147
|
- :author: cwby_bbop
|
148
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx8do6
|
148
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx8do6
|
149
149
|
:body: |-
|
150
150
|
Easy day today!! Got it in 33 lines of clean Ruby
|
151
151
|
|
152
152
|
[https://github.com/ealvar3z/aoc-2023/blob/master/day04.rb](https://github.com/ealvar3z/aoc-2023/blob/master/day04.rb)
|
153
153
|
:replies: []
|
154
154
|
- :author: lycheejuice225
|
155
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhg3d
|
155
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhg3d
|
156
156
|
:body: https://github.com/Animeshz/AdventOfCode2023
|
157
157
|
:replies: []
|
158
158
|
- :author: glebm
|
159
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhoph
|
159
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxhoph
|
160
160
|
:body: |-
|
161
161
|
Part 1:
|
162
162
|
|
@@ -189,15 +189,15 @@
|
|
189
189
|
```
|
190
190
|
:replies:
|
191
191
|
- :author: riffraff
|
192
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxjdse
|
192
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxjdse
|
193
193
|
:body: I think you do not need to `.to_i`, this should work fine with strings ("23" is the same as "23") , but I am not sure what is going on with spaces.
|
194
194
|
:replies:
|
195
195
|
- :author: glebm
|
196
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxl62c
|
196
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxl62c
|
197
197
|
:body: Yeah it should work fine with strings, there are no spaces left at that point. Numbers are much faster to compare and hash than strings though (not that it matters here).
|
198
198
|
:replies: []
|
199
199
|
- :author: careyi4
|
200
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbybnx3
|
200
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbybnx3
|
201
201
|
:body: |-
|
202
202
|
Another easier one than the day before... Starting to see a pattern here
|
203
203
|
|
@@ -206,7 +206,7 @@
|
|
206
206
|
[Video Walkthrough](https://youtu.be/6F4xUVLvQOM)
|
207
207
|
:replies: []
|
208
208
|
- :author: Jonathan_Frias
|
209
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbz8l0q
|
209
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbz8l0q
|
210
210
|
:body: |-
|
211
211
|
Part 1
|
212
212
|
|
@@ -257,14 +257,14 @@
|
|
257
257
|
```
|
258
258
|
:replies: []
|
259
259
|
- :author: trevor-e
|
260
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzafzf
|
260
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbzafzf
|
261
261
|
:body: |-
|
262
262
|
This day seemed a lot easier than the others, although at first I thought there was a bug in my part\_two since it took a few seconds to run. If anyone is curious I think my Ruby solutions are pretty straightforward to follow along, no bells and whistles:
|
263
263
|
|
264
264
|
[https://github.com/trevor-e/AdventOfCode2023/blob/main/day4/day4.rb](https://github.com/trevor-e/AdventOfCode2023/blob/main/day4/day4.rb)
|
265
265
|
:replies: []
|
266
266
|
- :author: 6f937f00-3166-11e4-8
|
267
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kc08jk5
|
267
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kc08jk5
|
268
268
|
:body: |-
|
269
269
|
```ruby
|
270
270
|
require 'set'
|
@@ -310,7 +310,7 @@
|
|
310
310
|
```
|
311
311
|
:replies: []
|
312
312
|
- :author: yourparadigm
|
313
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx5ynn
|
313
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx5ynn
|
314
314
|
:body: |-
|
315
315
|
Part 1 (1255)
|
316
316
|
|
@@ -346,7 +346,7 @@
|
|
346
346
|
```
|
347
347
|
:replies: []
|
348
348
|
- :author: Sharparam
|
349
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx6sp8
|
349
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx6sp8
|
350
350
|
:body: |-
|
351
351
|
```ruby
|
352
352
|
cards = Hash[ARGF.read.scan(/^[^\d]+(\d+): ([\d\]+) \| (.+)$/).map do
|
@@ -379,7 +379,7 @@
|
|
379
379
|
Part 2 is a bit messy, but oh well.
|
380
380
|
:replies: []
|
381
381
|
- :author: the_bengal_lancer
|
382
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx7t4h
|
382
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx7t4h
|
383
383
|
:body: |-
|
384
384
|
p1:
|
385
385
|
|
@@ -445,21 +445,21 @@
|
|
445
445
|
```
|
446
446
|
:replies: []
|
447
447
|
- :author: HAEC_EST_SPARTA
|
448
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx7uid
|
448
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbx7uid
|
449
449
|
:body: |-
|
450
450
|
##### [Solution on sourcehut](https://git.sr.ht/%7Eawsmith/advent-of-code/tree/2023-ruby/item/lib/day04.rb)
|
451
451
|
|
452
452
|
I spent far longer than I'd like to admit trying to figure out that I was initially parsing some card numbers as winning numbers. Once that issue was resolved, though, the solution to Part 2 came along pretty quickly — this was an instance where writing the optimised solution was faster than writing a non-optimal one. The recurrence relation was quite fun to figure out!
|
453
453
|
:replies: []
|
454
454
|
- :author: riffraff
|
455
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxitph
|
455
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxitph
|
456
456
|
:body: |-
|
457
457
|
I think this can be shorter, but I am happy enough I didn't hit nasty edge cases
|
458
458
|
|
459
459
|
EDIT: too long code block removed [https://gist.github.com/riffraff/0ebd1dc883e67539fb1bf0d43180d876](https://gist.github.com/riffraff/0ebd1dc883e67539fb1bf0d43180d876)
|
460
460
|
:replies: []
|
461
461
|
- :author: Symbroson
|
462
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxm0se
|
462
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxm0se
|
463
463
|
:body: |-
|
464
464
|
[Allez Cuisine!]
|
465
465
|
|
@@ -485,7 +485,7 @@
|
|
485
485
|
```
|
486
486
|
:replies: []
|
487
487
|
- :author: Annual-Management613
|
488
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxpmum
|
488
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxpmum
|
489
489
|
:body: |-
|
490
490
|
```ruby
|
491
491
|
# frozen_string_literal: true
|
@@ -522,11 +522,11 @@
|
|
522
522
|
```
|
523
523
|
:replies: []
|
524
524
|
- :author: Tourister6001PR
|
525
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxrtuk
|
525
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxrtuk
|
526
526
|
:body: https://github.com/aslam/advent-of-code/blob/main/day4/solver.rb
|
527
527
|
:replies: []
|
528
528
|
- :author: vinc686
|
529
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxvodm
|
529
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxvodm
|
530
530
|
:body: |-
|
531
531
|
Part 1:
|
532
532
|
|
@@ -554,7 +554,7 @@
|
|
554
554
|
https://github.com/vinc/advent-of-code/tree/master/ruby/2023/04
|
555
555
|
:replies: []
|
556
556
|
- :author: RelativeLead5
|
557
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxvtr1
|
557
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kbxvtr1
|
558
558
|
:body: |-
|
559
559
|
PART 1
|
560
560
|
|
@@ -607,7 +607,7 @@
|
|
607
607
|
```
|
608
608
|
:replies: []
|
609
609
|
- :author: aJanuary
|
610
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kby5u3j
|
610
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18actmy/2023_day_4_solutions/kby5u3j
|
611
611
|
:body: |-
|
612
612
|
Particularly proud of implementing part 2 with a single loop.
|
613
613
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: HAEC_EST_SPARTA
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2h3a5
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2h3a5
|
4
4
|
:body: |-
|
5
5
|
##### [Solution on sourcehut](https://git.sr.ht/%7Eawsmith/advent-of-code/tree/2023-ruby/item/lib/day05.rb)
|
6
6
|
|
7
7
|
I went with the optimised solution for today's problem rather than brute force, although the latter probably would have been more efficient in terms of getting to bed sooner :) I found Ruby's `Range` class to be disappointingly Spartan for this problem: it may be worth writing some more extension methods in anticipation of future days. Regardless, taking advantage of the fact that \>!mapping ranges are contiguous!\< made the range maintenance decently reasonable.
|
8
8
|
:replies:
|
9
9
|
- :author: glebm
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2ji8h
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2ji8h
|
11
11
|
:body: |-
|
12
12
|
Yeah Ruby should really add at least an `intersection` method for Ranges. Wanna submit a proposal?
|
13
13
|
|
@@ -16,18 +16,18 @@
|
|
16
16
|
`Range#empty?` was rejected 2 months ago but may be accepted in the future. https://bugs.ruby-lang.org/issues/13933
|
17
17
|
:replies:
|
18
18
|
- :author: HAEC_EST_SPARTA
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2k8sb
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2k8sb
|
20
20
|
:body: 'That''s a fair suggestion! It looks like someone already [submitted a proposal](https://bugs.ruby-lang.org/issues/16757) for `Range#intersection` a while back: I may set aside some free time in the coming days to advocate for that issue. Cheers!'
|
21
21
|
:replies:
|
22
22
|
- :author: Symbroson
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2vwdz
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2vwdz
|
24
24
|
:body: |-
|
25
25
|
would love to see this. Ruby has so many useful helper methods. Just found `tally` or `each_cons` recently and was like wtf this is a thing?
|
26
26
|
|
27
27
|
But ranges didn't get much of this love which is why I had to [implement it on my own](https://github.com/alex-Symbroson/Advent-of-Code/blob/master/2023/helper.rb) as well. Why can something so simple not make it into the std lib? Only takes two lines of ruby code for an intersection after all...
|
28
28
|
:replies: []
|
29
29
|
- :author: Symbroson
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2t49x
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2t49x
|
31
31
|
:body: |-
|
32
32
|
For part 2 I extended the range class by some [helper methods](https://github.com/alex-Symbroson/Advent-of-Code/blob/master/2023/helper.rb) to make the code more concise and it will probably help in the future :D
|
33
33
|
|
@@ -71,7 +71,7 @@
|
|
71
71
|
```
|
72
72
|
:replies: []
|
73
73
|
- :author: PassifloraCaerulea
|
74
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc31r60
|
74
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc31r60
|
75
75
|
:body: |-
|
76
76
|
[part 1](https://pastebin.com/zYqDRR0J)
|
77
77
|
|
@@ -80,11 +80,11 @@
|
|
80
80
|
I originally brute-forced the solution, manually splitting it up by seed range, but was unhappy. I went down a blind alley trying to reverse search with recursion, then I was inspired to iterate over a work queue of ranges, splitting and merging as appropriate. The last version is commented and IMO pretty readable, so I'm posting it here in case it helps anyone even though it's not the way I originally solved it.
|
81
81
|
:replies: []
|
82
82
|
- :author: Educational_Pie7376
|
83
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc3392l
|
83
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc3392l
|
84
84
|
:body: https://github.com/severeduck/adventofcode/blob/main/tasks/day5/main.rb
|
85
85
|
:replies: []
|
86
86
|
- :author: careyi4
|
87
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc4bwhb
|
87
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc4bwhb
|
88
88
|
:body: |-
|
89
89
|
Well, that was not fun at all! Got there in the end but nearly broke my brain getting the logic right.
|
90
90
|
|
@@ -93,7 +93,7 @@
|
|
93
93
|
[Video Walkthrough](https://youtu.be/hlmF_LICYTM)
|
94
94
|
:replies: []
|
95
95
|
- :author: careyi4
|
96
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc4bxgz
|
96
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc4bxgz
|
97
97
|
:body: |-
|
98
98
|
Well, that was not fun at all! Got there in the end but nearly broke my brain getting the logic right.
|
99
99
|
|
@@ -102,18 +102,18 @@
|
|
102
102
|
[Video Walkthrough](https://youtu.be/hlmF_LICYTM)
|
103
103
|
:replies: []
|
104
104
|
- :author: SleepingInsomniac
|
105
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc5b6ay
|
105
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc5b6ay
|
106
106
|
:body: |-
|
107
107
|
[Part 1](https://github.com/SleepingInsomniac/adventofcode2023/blob/master/2023-12-05/part_1.rb)
|
108
108
|
|
109
109
|
[LANGUAGE: Crystal] [Part 2 (not optimized ~3ish seconds execution time)](https://github.com/SleepingInsomniac/adventofcode2023/blob/master/2023-12-05/part_2.cr)
|
110
110
|
:replies:
|
111
111
|
- :author: SleepingInsomniac
|
112
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc6v08s
|
112
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc6v08s
|
113
113
|
:body: "[LANGUAGE: Crystal] [Part 2 - Optimized](https://github.com/SleepingInsomniac/adventofcode2023/blob/master/2023-12-05/part_2_optimized.cr)"
|
114
114
|
:replies: []
|
115
115
|
- :author: glebm
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2g7yu
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2g7yu
|
117
117
|
:body: |-
|
118
118
|
Part 1:
|
119
119
|
|
@@ -203,7 +203,7 @@
|
|
203
203
|
All my solutions: https://github.com/glebm/advent-of-code
|
204
204
|
:replies: []
|
205
205
|
- :author: lycheejuice225
|
206
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2lald
|
206
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc2lald
|
207
207
|
:body: |-
|
208
208
|
Both parts are optimized to be done within couple hundred of millseconds.
|
209
209
|
|
@@ -212,6 +212,6 @@
|
|
212
212
|
https://github.com/Animeshz/AdventOfCode2023/blob/main/day5\_b.rb
|
213
213
|
:replies: []
|
214
214
|
- :author: KULKING
|
215
|
-
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc33uyt
|
215
|
+
:url: https://www.reddit.com/r/adventofcode/comments/18b4b0r/2023_day_5_solutions/kc33uyt
|
216
216
|
:body: 'Part 1 & Part 2: https://github.com/kashif-umair/adventofcode/tree/main/2023/5%20-%20Seed%20Fertilizer'
|
217
217
|
:replies: []
|