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: Wattswing
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gindlts
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gindlts
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
```
|
21
21
|
:replies: []
|
22
22
|
- :author: Karl_Marxxx
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gey4mds
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gey4mds
|
24
24
|
:body: |-
|
25
25
|
# Ruby
|
26
26
|
|
@@ -38,11 +38,11 @@
|
|
38
38
|
```
|
39
39
|
:replies:
|
40
40
|
- :author: craigontour
|
41
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf5sjhu
|
41
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf5sjhu
|
42
42
|
:body: Hi. Please could you explain what reduce(:&) does.
|
43
43
|
:replies:
|
44
44
|
- :author: Karl_Marxxx
|
45
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf6ngxc
|
45
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf6ngxc
|
46
46
|
:body: |-
|
47
47
|
Reduce is a function that takes a list and combines, or "reduces", all the elements down to one value by taking the first two values and combining them, then combining that result with the next value, and so on. Of course, you might want to decide how things get combined, and so you can specify another function that tells you how to combine things. For example, say I have a list of numbers: [1, 2, 5, 6, 2]. If I call reduce on this list, and specify that the combining operation is "+", then I get ((((1+2)+5)+6)+2) = 16. In ruby, that could look like `[1, 2, 5, 6, 2].reduce(:+)`. "`:+`" is fancy ruby syntax that refers to the addition operator.
|
48
48
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
So long story short reduce(:&) means I'm calling the reduce function on a list using the "&" intersection operator. Apologies if you already knew all that stuff above.
|
61
61
|
:replies:
|
62
62
|
- :author: craigontour
|
63
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf6uomq
|
63
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf6uomq
|
64
64
|
:body: |-
|
65
65
|
That's one of the more comprehensive explanations I've read so far.
|
66
66
|
|
@@ -69,23 +69,23 @@
|
|
69
69
|
Thanks.
|
70
70
|
:replies: []
|
71
71
|
- :author: McPhage
|
72
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gey68e0
|
72
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gey68e0
|
73
73
|
:body: Where / how dd you handle spaces, capital letters, and punctuation in the input?
|
74
74
|
:replies:
|
75
75
|
- :author: Karl_Marxxx
|
76
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf01vcs
|
76
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf01vcs
|
77
77
|
:body: "`.split` to handle spaces, and I don't believe there was punctuation/capital letters in the input"
|
78
78
|
:replies:
|
79
79
|
- :author: McPhage
|
80
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf03w3e
|
80
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf03w3e
|
81
81
|
:body: Yeah, so it turns out Chrome “translated” mine from Polish to English first, so I ended up with some weird stuff in my input.
|
82
82
|
:replies:
|
83
83
|
- :author: Karl_Marxxx
|
84
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf09g5d
|
84
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gf09g5d
|
85
85
|
:body: Oh wow! Haha.
|
86
86
|
:replies: []
|
87
87
|
- :author: zxywx
|
88
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gexhjod
|
88
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gexhjod
|
89
89
|
:body: |-
|
90
90
|
# Ruby Solution
|
91
91
|
|
@@ -102,7 +102,7 @@
|
|
102
102
|
```
|
103
103
|
:replies: []
|
104
104
|
- :author: The-more-you-gnoll
|
105
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewydad
|
105
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewydad
|
106
106
|
:body: |-
|
107
107
|
Ruby
|
108
108
|
|
@@ -131,7 +131,7 @@
|
|
131
131
|
```
|
132
132
|
:replies: []
|
133
133
|
- :author: tckmn
|
134
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7bz7
|
134
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7bz7
|
135
135
|
:body: |-
|
136
136
|
ruby 1/1 woo
|
137
137
|
|
@@ -141,30 +141,30 @@
|
|
141
141
|
```
|
142
142
|
:replies:
|
143
143
|
- :author: mebeim
|
144
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7h2s
|
144
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7h2s
|
145
145
|
:body: That is just... amazing timing and amazing code. Kudos!
|
146
146
|
:replies: []
|
147
147
|
- :author: padiwik
|
148
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gescqjv
|
148
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gescqjv
|
149
149
|
:body: Any reason you use `split` in the first one but `lines` in the second one?
|
150
150
|
:replies:
|
151
151
|
- :author: tckmn
|
152
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesf7sk
|
152
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesf7sk
|
153
153
|
:body: no lol, the first time my brain was like "ok how do i kill all the whitespace" and it spit out `.split.join` as a unit, then for part 2 i deleted everything in the braces to start again and the first thing that came to mind to transform the lines was `.lines.map`
|
154
154
|
:replies: []
|
155
155
|
- :author: maccosmo
|
156
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gevy4a5
|
156
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gevy4a5
|
157
157
|
:body: "just found your code and saw that your's is very similar to mine :D\n\nbtw, you could remove some bytes\n\ninstead of `\"\\n\\n\"` you can write `?\\n*2` to safe 1 byte. and `sum` takes a block, so you could replace your `map` with `sum` instead cheers! \U0001F37B"
|
158
158
|
:replies: []
|
159
159
|
- :author: prafster
|
160
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewvliz
|
160
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewvliz
|
161
161
|
:body: |-
|
162
162
|
It's admirable that you managed to understand part 1 in 45s let alone answer it!
|
163
163
|
|
164
164
|
I'm learning Dart whilst doing these puzzles but I'm tempted to use Ruby because it is a lovely language.
|
165
165
|
:replies: []
|
166
166
|
- :author: Unihedron
|
167
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges6nvc
|
167
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges6nvc
|
168
168
|
:body: |-
|
169
169
|
Ruby 9/31
|
170
170
|
|
@@ -179,7 +179,7 @@
|
|
179
179
|
```
|
180
180
|
:replies: []
|
181
181
|
- :author: el_daniero
|
182
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gets91l
|
182
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gets91l
|
183
183
|
:body: |-
|
184
184
|
# Ruby
|
185
185
|
|
@@ -199,7 +199,7 @@
|
|
199
199
|
```
|
200
200
|
:replies: []
|
201
201
|
- :author: maccosmo
|
202
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gett48l
|
202
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gett48l
|
203
203
|
:body: |-
|
204
204
|
**Ruby** , Part 1 and 2 in one line (input filename is called "i")
|
205
205
|
|
@@ -228,7 +228,7 @@
|
|
228
228
|
```
|
229
229
|
:replies: []
|
230
230
|
- :author: shandley256
|
231
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesr6wv
|
231
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesr6wv
|
232
232
|
:body: |-
|
233
233
|
# Day 6 in Ruby
|
234
234
|
|
@@ -253,7 +253,7 @@
|
|
253
253
|
See: [https://ruby-doc.org/stdlib-2.7.2/libdoc/set/rdoc/Set.html#method-i-7C](https://ruby-doc.org/stdlib-2.7.1/libdoc/set/rdoc/Set.html#method-i-7C)
|
254
254
|
:replies:
|
255
255
|
- :author: 0rac1e
|
256
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gew4van
|
256
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gew4van
|
257
257
|
:body: |-
|
258
258
|
This is super nice!
|
259
259
|
|
@@ -262,18 +262,18 @@
|
|
262
262
|
Apart from splitting my output, I didn't break it down further to lists of charachter-lists, so I came to solve part one without doing a union.
|
263
263
|
:replies: []
|
264
264
|
- :author: petercooper
|
265
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/get6luq
|
265
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/get6luq
|
266
266
|
:body: Good use of `tap` to get both solutions into one tight script. I always do two separate scripts for part one and two but this is a neat approach.
|
267
267
|
:replies:
|
268
268
|
- :author: shandley256
|
269
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getg8w6
|
269
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getg8w6
|
270
270
|
:body: |-
|
271
271
|
Cheers Peter!
|
272
272
|
|
273
273
|
I usually write two scripts too :-) Typically one ends up requiring the other to re-use common code but I've been doing a bit of Elixir lately and the functional pipeline approach is quite nice for smaller chunks of code.
|
274
274
|
:replies: []
|
275
275
|
- :author: jschulenklopper
|
276
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gev0hjz
|
276
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gev0hjz
|
277
277
|
:body: |-
|
278
278
|
A puzzle that fits well with **Ruby** :
|
279
279
|
|
@@ -288,14 +288,14 @@
|
|
288
288
|
```
|
289
289
|
:replies:
|
290
290
|
- :author: dev_all_the_ops
|
291
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewudla
|
291
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gewudla
|
292
292
|
:body: |-
|
293
293
|
Since ruby 1.9 `reduce(&:&)` could be replaced by `reduce(:&)`.
|
294
294
|
|
295
295
|
[https://stackoverflow.com/a/13093610/1626687](https://stackoverflow.com/a/13093610/1626687)
|
296
296
|
:replies: []
|
297
297
|
- :author: jtgorn
|
298
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges8lct
|
298
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges8lct
|
299
299
|
:body: |-
|
300
300
|
Ruby
|
301
301
|
|
@@ -316,7 +316,7 @@
|
|
316
316
|
```
|
317
317
|
:replies: []
|
318
318
|
- :author: ni3t
|
319
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges8zcs
|
319
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges8zcs
|
320
320
|
:body: |-
|
321
321
|
# Ruby
|
322
322
|
|
@@ -334,7 +334,7 @@
|
|
334
334
|
```
|
335
335
|
:replies: []
|
336
336
|
- :author: CodeIsTheEnd
|
337
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesbowo
|
337
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesbowo
|
338
338
|
:body: |-
|
339
339
|
**Ruby:** 2:14/8:44, 59/786
|
340
340
|
|
@@ -343,7 +343,7 @@
|
|
343
343
|
Finally cracked the global leaderboard! But I left out a break statement and lost a ton of time on Part 2.
|
344
344
|
:replies: []
|
345
345
|
- :author: Krakhan
|
346
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gese5jk
|
346
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gese5jk
|
347
347
|
:body: |-
|
348
348
|
**Ruby**
|
349
349
|
|
@@ -361,7 +361,7 @@
|
|
361
361
|
```
|
362
362
|
:replies:
|
363
363
|
- :author: Krakhan
|
364
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/geuv3sg
|
364
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/geuv3sg
|
365
365
|
:body: |-
|
366
366
|
Cleaned up a bit before bed and after waking up.
|
367
367
|
|
@@ -380,7 +380,7 @@
|
|
380
380
|
```
|
381
381
|
:replies: []
|
382
382
|
- :author: jeffers0n
|
383
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getzqee
|
383
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getzqee
|
384
384
|
:body: |-
|
385
385
|
Ruby. I'm finally learning to utilize more of Ruby's builtin methods instead of using .each for everything.
|
386
386
|
|
@@ -422,11 +422,11 @@
|
|
422
422
|
```
|
423
423
|
:replies:
|
424
424
|
- :author: jtgorn
|
425
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/geuzqym
|
425
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/geuzqym
|
426
426
|
:body: You can replace reduce(:+) by sum, althought if you move length to the first map!, it spimplifies the second one.
|
427
427
|
:replies: []
|
428
428
|
- :author: jschulenklopper
|
429
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gev02wj
|
429
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gev02wj
|
430
430
|
:body: |-
|
431
431
|
That can be done somewhat more succinct:
|
432
432
|
|
@@ -441,7 +441,7 @@
|
|
441
441
|
```
|
442
442
|
:replies: []
|
443
443
|
- :author: angryfeet73
|
444
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesd3dy
|
444
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesd3dy
|
445
445
|
:body: |-
|
446
446
|
# Ruby
|
447
447
|
|
@@ -457,7 +457,7 @@
|
|
457
457
|
```
|
458
458
|
:replies: []
|
459
459
|
- :author: frontpageminus
|
460
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7b8x
|
460
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/ges7b8x
|
461
461
|
:body: |-
|
462
462
|
Ruby 1521/358. I misread the question and did part two for part one initially.
|
463
463
|
|
@@ -487,11 +487,11 @@
|
|
487
487
|
```
|
488
488
|
:replies:
|
489
489
|
- :author: MichalMarsalek
|
490
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesdyzn
|
490
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesdyzn
|
491
491
|
:body: Yeah the same thing happened to me... placed 850/150….
|
492
492
|
:replies: []
|
493
493
|
- :author: blafunke
|
494
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesadqe
|
494
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/gesadqe
|
495
495
|
:body: |-
|
496
496
|
Now I know my abc's
|
497
497
|
|
@@ -531,7 +531,7 @@
|
|
531
531
|
```
|
532
532
|
:replies: []
|
533
533
|
- :author: petercooper
|
534
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/get6b0k
|
534
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/get6b0k
|
535
535
|
:body: |-
|
536
536
|
# Ruby
|
537
537
|
|
@@ -558,7 +558,7 @@
|
|
558
558
|
```
|
559
559
|
:replies: []
|
560
560
|
- :author: nata79
|
561
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getjz31
|
561
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k7ndux/2020_day_06_solutions/getjz31
|
562
562
|
:body: |-
|
563
563
|
**Ruby**
|
564
564
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: DmitryShvetsov
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/ggz5ipr
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/ggz5ipr
|
4
4
|
:body: |-
|
5
5
|
# Ruby
|
6
6
|
|
@@ -13,11 +13,11 @@
|
|
13
13
|
in part 2, it became obvious how to navigate the data as a tree using the depth-first search, which led to a more straightforward solution
|
14
14
|
:replies: []
|
15
15
|
- :author: skawid
|
16
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf3i6dx
|
16
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf3i6dx
|
17
17
|
:body: 'Second day playing with ruby! Not sure if it''ll replace python for me, but it''s nice to try: https://github.com/simonbrahan/aoc2020/blob/master/day7/main.rb'
|
18
18
|
:replies: []
|
19
19
|
- :author: Ryuujinx
|
20
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf0sr0o
|
20
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf0sr0o
|
21
21
|
:body: |-
|
22
22
|
# Ruby
|
23
23
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
Regex please, if I want to fuck my performance just let me.
|
33
33
|
:replies: []
|
34
34
|
- :author: Karl_Marxxx
|
35
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf01zpu
|
35
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf01zpu
|
36
36
|
:body: |-
|
37
37
|
# Ruby
|
38
38
|
|
@@ -89,7 +89,7 @@
|
|
89
89
|
```
|
90
90
|
:replies: []
|
91
91
|
- :author: el_daniero
|
92
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf01dpo
|
92
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gf01dpo
|
93
93
|
:body: |-
|
94
94
|
#namingThings :/
|
95
95
|
|
@@ -134,7 +134,7 @@
|
|
134
134
|
```
|
135
135
|
:replies: []
|
136
136
|
- :author: zxywx
|
137
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexn7cd
|
137
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexn7cd
|
138
138
|
:body: |-
|
139
139
|
# Ruby
|
140
140
|
|
@@ -188,7 +188,7 @@
|
|
188
188
|
```
|
189
189
|
:replies: []
|
190
190
|
- :author: nilsecc
|
191
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gez6mky
|
191
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gez6mky
|
192
192
|
:body: |-
|
193
193
|
**Ruby:**
|
194
194
|
|
@@ -280,7 +280,7 @@
|
|
280
280
|
```
|
281
281
|
:replies: []
|
282
282
|
- :author: CodeIsTheEnd
|
283
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex50tj
|
283
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex50tj
|
284
284
|
:body: |-
|
285
285
|
**Ruby:** 14:12/19:59, 470/338
|
286
286
|
|
@@ -289,7 +289,7 @@
|
|
289
289
|
Slightly tricky string parsing, needing to handle bag/bags, the trailing '.' and the leading numbers. I didn't try to guess Ruby's `String#split(str, limit)` method for splitting on just the first occurrence, and instead did hack stuff with `index` and slicing the string.
|
290
290
|
:replies: []
|
291
291
|
- :author: blafunke
|
292
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex7a0p
|
292
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex7a0p
|
293
293
|
:body: |-
|
294
294
|
**Ruby**
|
295
295
|
|
@@ -347,7 +347,7 @@
|
|
347
347
|
```
|
348
348
|
:replies: []
|
349
349
|
- :author: petercooper
|
350
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexju4z
|
350
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexju4z
|
351
351
|
:body: |-
|
352
352
|
# Ruby
|
353
353
|
|
@@ -385,18 +385,18 @@
|
|
385
385
|
```
|
386
386
|
:replies:
|
387
387
|
- :author: petercooper
|
388
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexmrpc
|
388
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexmrpc
|
389
389
|
:body: |-
|
390
390
|
The way I store the information about what a bag holds is unorthodox based on my reading of other solutions here.
|
391
391
|
|
392
392
|
Rather than storing a quantity and a color, I store the color numerous times. So instead of [3, "red"], I'll store ["red", "red", "red"] .. this makes the code behind my eventual counting approach (essentially the hottest loop in the program) more efficient, but in a real world scenario the memory usage would be frowned upon! ;-)
|
393
393
|
:replies: []
|
394
394
|
- :author: "[deleted]"
|
395
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/geya3as
|
395
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/geya3as
|
396
396
|
:body: No ruby yet? Then I'll share my solution [here](https://github.com/Ganon11/AdventCode/blob/master/2020/Day7/src/Day7.rb)!
|
397
397
|
:replies: []
|
398
398
|
- :author: jtgorn
|
399
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/geyf2ul
|
399
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/geyf2ul
|
400
400
|
:body: |-
|
401
401
|
Did not see a short ruby yet, so here is mine:
|
402
402
|
|
@@ -431,7 +431,7 @@
|
|
431
431
|
```
|
432
432
|
:replies: []
|
433
433
|
- :author: frontpageminus
|
434
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gewyjqt
|
434
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gewyjqt
|
435
435
|
:body: |-
|
436
436
|
Ruby 34/51. I forgot to handle bags containing no other bags while parsing, which wasn't a problem for the first one but definitely was for the second. Oh well.
|
437
437
|
|
@@ -483,7 +483,7 @@
|
|
483
483
|
```
|
484
484
|
:replies: []
|
485
485
|
- :author: ni3t
|
486
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex26kv
|
486
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gex26kv
|
487
487
|
:body: |-
|
488
488
|
# Ruby
|
489
489
|
|
@@ -539,7 +539,7 @@
|
|
539
539
|
```
|
540
540
|
:replies: []
|
541
541
|
- :author: Krakhan
|
542
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexm197
|
542
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8a31f/2020_day_07_solutions/gexm197
|
543
543
|
:body: |-
|
544
544
|
**Ruby**
|
545
545
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: jeffers0n
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf6d3jz
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf6d3jz
|
4
4
|
:body: |-
|
5
5
|
Ruby. I found this much easier than day 07.
|
6
6
|
|
@@ -48,15 +48,15 @@
|
|
48
48
|
```
|
49
49
|
:replies:
|
50
50
|
- :author: rune_kg
|
51
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gfkdzu8
|
51
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gfkdzu8
|
52
52
|
:body: Very pretty!
|
53
53
|
:replies: []
|
54
54
|
- :author: tckmn
|
55
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf0zdyb
|
55
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf0zdyb
|
56
56
|
:body: "[ruby 6/2](https://gist.github.com/tckmn/ba6c243bfde8d73c4e92033f7f0cabef), unedited from my part 2 submission, posting because it's pretty silly. nothing like reading the input file 635 times to avoid bugs from forgetting to copy / reset things lol"
|
57
57
|
:replies: []
|
58
58
|
- :author: petercooper
|
59
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1nh3w
|
59
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1nh3w
|
60
60
|
:body: |-
|
61
61
|
# Ruby
|
62
62
|
|
@@ -100,14 +100,14 @@
|
|
100
100
|
```
|
101
101
|
:replies: []
|
102
102
|
- :author: Ryuujinx
|
103
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf2g2b8
|
103
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf2g2b8
|
104
104
|
:body: |-
|
105
105
|
# Ruby
|
106
106
|
|
107
107
|
This one I didn't find terribly difficult, just moving some pointers around an array really. Code: https://github.com/Ryuujinx/aoc2020/tree/main/day8
|
108
108
|
:replies: []
|
109
109
|
- :author: Karl_Marxxx
|
110
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf2jcsg
|
110
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf2jcsg
|
111
111
|
:body: |-
|
112
112
|
# Ruby
|
113
113
|
|
@@ -168,7 +168,7 @@
|
|
168
168
|
```
|
169
169
|
:replies: []
|
170
170
|
- :author: frontpageminus
|
171
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf0yz10
|
171
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf0yz10
|
172
172
|
:body: |-
|
173
173
|
Ruby 423/218
|
174
174
|
|
@@ -221,7 +221,7 @@
|
|
221
221
|
```
|
222
222
|
:replies: []
|
223
223
|
- :author: CodeIsTheEnd
|
224
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf12k89
|
224
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf12k89
|
225
225
|
:body: |-
|
226
226
|
**Ruby:** 4:41/9:25, 348/203
|
227
227
|
|
@@ -230,7 +230,7 @@
|
|
230
230
|
Forgot to increment the instruction pointer after updating the accumulator in Part 1 and lost 40 seconds waiting for the submission timeout. But otherwise pretty straightforward. Will have to clean it up before the next processor problem!
|
231
231
|
:replies:
|
232
232
|
- :author: petercooper
|
233
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1n8t6
|
233
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1n8t6
|
234
234
|
:body: |-
|
235
235
|
I took a similar approach to you, but got majorly screwed by `dup` not being a deep clone, as I was editing the inner array directly (e.g. like `new_ops[i][0] = :nop` would have been in your scenario) and screwing up my original code ;-) Wasted 10 minutes of my time debugging that one.. oops! :-)
|
236
236
|
|
@@ -243,7 +243,7 @@
|
|
243
243
|
```
|
244
244
|
:replies: []
|
245
245
|
- :author: Krakhan
|
246
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf159kl
|
246
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf159kl
|
247
247
|
:body: |-
|
248
248
|
# Ruby
|
249
249
|
|
@@ -300,14 +300,14 @@
|
|
300
300
|
```
|
301
301
|
:replies: []
|
302
302
|
- :author: "[deleted]"
|
303
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf19a9e
|
303
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf19a9e
|
304
304
|
:body: |-
|
305
305
|
The worst possible solution in ruby:
|
306
306
|
|
307
307
|
[https://github.com/sreedevk/advent-of-code/blob/master/2020/day8/main.rb](https://github.com/sreedevk/advent-of-code/blob/master/2020/day8/main.rb)
|
308
308
|
:replies: []
|
309
309
|
- :author: hamnixster
|
310
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1a0rj
|
310
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf1a0rj
|
311
311
|
:body: |-
|
312
312
|
Here is my ruby solution. For part 2, using the marked up instructions from part one, it works backwards from the last intcode looking for candidates to flip that were visited in the course of executing part1. Checking these, I got the answer.
|
313
313
|
|
@@ -387,7 +387,7 @@
|
|
387
387
|
```
|
388
388
|
:replies: []
|
389
389
|
- :author: odlp
|
390
|
-
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf28t0s
|
390
|
+
:url: https://www.reddit.com/r/adventofcode/comments/k8xw8h/2020_day_08_solutions/gf28t0s
|
391
391
|
:body: |-
|
392
392
|
Here's my [Ruby solution](https://github.com/odlp/advent-of-code-2020/blob/main/day-8/boot.rb):
|
393
393
|
|