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: Krakhan
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfrw3ms
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfrw3ms
|
4
4
|
:body: |-
|
5
5
|
# Ruby
|
6
6
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
[paste](https://topaz.github.io/paste/#XQAAAQAYBwAAAAAAAAAnE8bNrcUaSC1RPLSslbg3C3mUhvgred777SJtxMUlLYkrtfCu151ao31yyyD8usLO9czk+cI2fDLKqVTt2oetB67KB0VGUVGo6zp2PZQn63Qyn/NGS3/c1hTo734IXYgBWXS6ZLltXzaHhfLEeahYanci5X8hcf4/vKW2FH6TTmJrIejunfUIoxOO3MPsQYVDI33EbFIHQXAzp/LEvPFDL+SIL9K0bmzYEtQwF7EL0SG3DBRvoR0qcdHG08yKABs/AS1ha78kfAKRWBUfDv6TywDCT3k8k6JlJBPionqsVfa/sng6hEwskfxiZeDo661eSzKxVU58vuwDOJsBaAYGApDh+cAzxnA9E0Dpn7ygvXX8XKVqsaLp6nyRRjCc0OQjoSM6hRCqnqdI4AtIE/q1oHNmdiih6WjRlE88mqp30hmn6TlTSv/WsShDHG7etbqxUuowg/wVljBERK65sWf0y8g/60Cd8RfpKifIaq4N8MHH2JC72lakOKPI0w4O3G8pZQ+NAt8xrlxu/XGUWXw3rH7dLd9LRjl/ilw1fru1Bf6Nhpx7s73HgAH6O9IJphxG0bag5HNd7BixjcMFnUHU+TcVfRdfmARir2t1DTR1YISUbey7tgT5vA79KX3BqvrC91xQiHANPyhU0IHSkVhqHk4mcYMmjncsOW0MccbMKnLSHXA4Xjae4cCM7DHXvkcH4IjJ9TO4dBJBn0O7ldLVBLz/wfvAgjR6ca6P7+aJOee4xca+NouqzYJrvhyX//IDh+jpycHf3TYPwdG+WcfaNgUUH4ADcXbU8C0uTyudP0oyzSOnNFgnISmyM2tMvM7P4Ms8nBVaLIhHl4LBRE/ztM6RiBT1mBr3FqStwlGJXkMNRaqbrv/BBfDYgG+CZtV6DbJMwifWy8q1DIfMGvuj0FZJHnUBvZl1aU8hFpZQprw2mHkBluyxTpMGS5DSWe7FBO03FSucOQMjS9JYqvsO3JKOfWwPzR6YQj4CIaOwgyhT6vsQf7oxBkCHhHnkDIEK37kyEKDNeipgNDlOmL7LLXI+vbvJIF6KZwpXLbXtMqdoqY+Yo/ROKjUn8A12WDi0ACaP00TitigSABRIVHF7Ketf/K6rOnIp1WJPCe7yxbBsUNpsYYK/kf66HeA=)
|
10
10
|
:replies: []
|
11
11
|
- :author: adjudicator
|
12
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfra3pk
|
12
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfra3pk
|
13
13
|
:body: |-
|
14
14
|
OO Ruby part b, with both iterative and recursive implentations of the same solution.
|
15
15
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
https://nopaste.xyz/?9b0e91305941a03c#3o68g4zxLknXSoPY6XsRyZYak7JVz6cvQ6cMGV7dYaKf
|
21
21
|
:replies: []
|
22
22
|
- :author: "[deleted]"
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfr2njd
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfr2njd
|
24
24
|
:body: |-
|
25
25
|
# Ruby
|
26
26
|
|
@@ -62,7 +62,7 @@
|
|
62
62
|
```
|
63
63
|
:replies: []
|
64
64
|
- :author: Karl_Marxxx
|
65
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfqych1
|
65
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfqych1
|
66
66
|
:body: |-
|
67
67
|
# Ruby
|
68
68
|
|
@@ -97,14 +97,14 @@
|
|
97
97
|
```
|
98
98
|
:replies: []
|
99
99
|
- :author: parentheses-of-doom
|
100
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnmkkd
|
100
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnmkkd
|
101
101
|
:body: |-
|
102
102
|
[Ruby](https://github.com/Prajjwal/advent-of-code/blob/master/2020/ruby/day_13.rb)
|
103
103
|
|
104
104
|
Not a huge fan of today's problem, because anyone that didn't know about the Chinese Remainder Theorem didn't really stand a chance of solving it. Pretty artificial in terms of difficulty.
|
105
105
|
:replies:
|
106
106
|
- :author: MimHufford
|
107
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfoi0qx
|
107
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfoi0qx
|
108
108
|
:body: |-
|
109
109
|
I solved it without knowing CRT.
|
110
110
|
|
@@ -115,7 +115,7 @@
|
|
115
115
|
[Here's mine](https://github.com/mimhufford/AdventOfCode/blob/master/2020/13.jai)
|
116
116
|
:replies: []
|
117
117
|
- :author: spookywooky_FE
|
118
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnr8gq
|
118
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnr8gq
|
119
119
|
:body: |-
|
120
120
|
I had, again, big problems to parse the problem statement, and to parse the problem input. For part2 I did read about [diophantine equations](https://cp-algorithms.com/algebra/linear-diophantine-equation.html) for like 20 minutes.
|
121
121
|
|
@@ -124,19 +124,19 @@
|
|
124
124
|
I heard of CRT before, but was never able to memoize how it works.
|
125
125
|
:replies:
|
126
126
|
- :author: Dementati
|
127
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggu6foy
|
127
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggu6foy
|
128
128
|
:body: They did help me. I modelled the problem as a system of Diophantine equations and used a library to solve it.
|
129
129
|
:replies:
|
130
130
|
- :author: spookywooky_FE
|
131
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggvj6pm
|
131
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggvj6pm
|
132
132
|
:body: Well, a system of diophantine equations is more or less CRT. However, of course they can help ;) But they did not help me, because I did not get how to apply them.
|
133
133
|
:replies:
|
134
134
|
- :author: Dementati
|
135
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggw9sgh
|
135
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/ggw9sgh
|
136
136
|
:body: In what sense are they CRT? CRT seems completely different to me, not least because it requires the divisors to be coprime. And yeah, the way you phrased your comment made it sound like you were saying that Diophantine equations don't help in general.
|
137
137
|
:replies: []
|
138
138
|
- :author: Hydroxon1um
|
139
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfq7uu2
|
139
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfq7uu2
|
140
140
|
:body: |-
|
141
141
|
Actually some basic number theory (modular arithmetic and prime numbers) was sufficient to derive the sieving algorithm.
|
142
142
|
|
@@ -145,14 +145,14 @@
|
|
145
145
|
[https://en.wikipedia.org/wiki/Chinese\_remainder\_theorem#Search\_by\_sieving](https://en.wikipedia.org/wiki/Chinese_remainder_theorem#Search_by_sieving)
|
146
146
|
:replies: []
|
147
147
|
- :author: frontpageminus
|
148
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnjtw8
|
148
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnjtw8
|
149
149
|
:body: |-
|
150
150
|
Ruby 911/1809. I've never heard of the Chinese Remainder Theorem, so I cheated and looked here after about an hour of struggling with the math. And then I cheated some more by copying a CRT solver from Rosetta Code.
|
151
151
|
|
152
152
|
[paste](https://topaz.github.io/paste/#XQAAAQDjAgAAAAAAAAARiAqGkkN7pUjVWW5O/8kAHtqieaDJW/x6fZAz4dPiQJToiDdFET3JIRXOC1zTFN8lrRTYtBiOuM94vK3SDrc+EyQY/mtgIi57X6SacUcFQ7OxrHgtHERfN996gXIXrNl7uMAjllAJGHaoC+er6HZC9pBmSAwW/Rub7ZdQPcvwPatBWiTNsY/S67wDftjTA5uzND80YFd6bMC5KwMXQBs68thKgzE9cITifEa28H48s/nU9To8v0iSas7T88Errs+8CzEuLDiwPh4mH9i+gTB16zvomGABL4gigPrxbZh0B0Ck/nbLp0R4rA2QXzaLbgtPVk5W3E+s8H+K5u/OH91C1aczTUs2d0GoMgQGdv8t0XIZdyJOxl1HEStcG9nJxDErhFzoPOqo5wsySgVAvxgNDOthpvcnBULYCFE50Fe2PB0Og7X6yqHoMsDhaiiVWopZoXJhdf7nhEKy7mnDOC0S/w2F35fGhCMROEaztYL/EEJVCkvbz8cakuu1Q7atprBmMgS6h96jaTukGd1j+hoYjvOLZuG6XJxi3RvWkxIbP2fSXCS/Jd5pggwIPlIJdayq/+g3cKz/6CH7nQ==)
|
153
153
|
:replies: []
|
154
154
|
- :author: gurgeous
|
155
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnm3g1
|
155
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnm3g1
|
156
156
|
:body: |-
|
157
157
|
Ruby, 18/1577
|
158
158
|
|
@@ -161,7 +161,7 @@
|
|
161
161
|
https://gist.github.com/gurgeous/045938641f5373a06b702faf3297eb1f
|
162
162
|
:replies: []
|
163
163
|
- :author: CodeIsTheEnd
|
164
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnpua3
|
164
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfnpua3
|
165
165
|
:body: |-
|
166
166
|
**Ruby:** 7:00/24:19, 737/289
|
167
167
|
|
@@ -170,7 +170,7 @@
|
|
170
170
|
Problems are getting harder! Part 1 could have gone a little better, but I'm reasonably pleased with how Part 2 went, given how much my rank increased.
|
171
171
|
:replies: []
|
172
172
|
- :author: petercooper
|
173
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfpdmjs
|
173
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kc4njx/2020_day_13_solutions/gfpdmjs
|
174
174
|
:body: |-
|
175
175
|
# Ruby
|
176
176
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: MintyMiku
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gg08r3p
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gg08r3p
|
4
4
|
:body: |-
|
5
5
|
# [Ruby](https://github.com/Ciremun/AOC-2020/blob/main/14%20-%20Ruby/14.rb)
|
6
6
|
|
7
7
|
it just works 4Head
|
8
8
|
:replies: []
|
9
9
|
- :author: Krakhan
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfvx57t
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfvx57t
|
11
11
|
:body: |-
|
12
12
|
# Ruby
|
13
13
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
[paste](https://topaz.github.io/paste/#XQAAAQA2BgAAAAAAAAAkk4as5/1fmEdghelgYMg6VrsIK/UBR2vu5GgUjeztZFOMhdNgpLgx74sjP7cfZLLgPnfjH19j93zimPOcyRiaOsNyuGVl34T27q33yI7WUCYtyV2RlViqdyqRz5NtpdJ8M/ltXHnk8kEOLgarODukYeCLCPGbwu1QIgxrm9rYyE8ANN7y3Dv9Ui1ShiEJIpbPcE+XTbtznyfGhw3WUFT0w9gDEioL/moxPa/0CAkSj29eD1GFxihtgyjXco+KGOaJZHdFmBUxgk+XNssXjMFLyelsug4QkyV5iCCG4HhrdnJFfuMi7Ae68M2+b/FGtbZdmhw+Cz9BdQHDP78I5I8VTO+QBJSLrIeM5/DYVGXNbzUOn+7SRDSa+W+OUkqUUJGAEEsH2mYUEWNHLJuTY5B+DflNw+qywtMyuwrOr0iD2whD+W1ebeBfIlWK6tjcC4YXh0ELkA7qxSHAX6HuHG8cPjZhYjUrKZwHDRJjuqeNljg85p5iy5sGkz+PhU0XdQ4vtPR/vQ6Tj7+DAFKK52MLiI5p6de3AYwp+XqrLdsZ1kygso5P9PST6EHGFqFVZDtdxe83ci+b1yl3Glkb217rnh9FHuS2RLHVsRxYVPLYjSJtvHYUciIgid2wyua3UZ3JxSmfvXegE+2Gl9daPWO2dhjMbuYD8zVb6scZGkUOYzTe/xEqxEMu+5MFep8nu+XtIXXitdar2n48YGgzL54snH3gAqXqmk+6qDuKDiSVTrLooeE7PrE8FHbNW447wqLjrLkBEURd35JPHGTqsUaIlddtKB1UwG1lazTvfmNWXX2WTEBjvBa6sYMbVR7ZCjX5tsToqrH5HyUX74nb/mpajkXBGR4fXSJioWqlA53DfYjRwlU9g0U/Nxsv1BAeZfwY/fa7kpw=)
|
17
17
|
:replies: []
|
18
18
|
- :author: willkill07
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfvakic
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfvakic
|
20
20
|
:body: |-
|
21
21
|
# Ruby
|
22
22
|
|
@@ -27,7 +27,7 @@
|
|
27
27
|
I defined an abstract base class + two implementations for each part. Overall I'm pretty pleased!
|
28
28
|
:replies: []
|
29
29
|
- :author: adjudicator
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfuh7xh
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfuh7xh
|
31
31
|
:body: |-
|
32
32
|
Ruby Part 2.
|
33
33
|
|
@@ -40,14 +40,14 @@
|
|
40
40
|
refactored a bit: https://pastebin.com/w4zyYfSJ
|
41
41
|
:replies: []
|
42
42
|
- :author: billiamthesecond
|
43
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsezb0
|
43
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsezb0
|
44
44
|
:body: |-
|
45
45
|
[Ruby](https://www.billiam.org/advent-of-code/14.html)
|
46
46
|
|
47
47
|
Needs cleanup, but another successful use of repeated\_permutation
|
48
48
|
:replies:
|
49
49
|
- :author: adjudicator
|
50
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfuzeql
|
50
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfuzeql
|
51
51
|
:body: |-
|
52
52
|
> repeated\_permutation
|
53
53
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
```
|
69
69
|
:replies: []
|
70
70
|
- :author: justinpaulson
|
71
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsa36z
|
71
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsa36z
|
72
72
|
:body: |-
|
73
73
|
Ruby 325 / 310
|
74
74
|
|
@@ -77,7 +77,7 @@
|
|
77
77
|
[Github](https://github.com/justinpaulson/advent-of-code-2020/blob/master/day_14.rb)
|
78
78
|
:replies: []
|
79
79
|
- :author: odlp
|
80
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfszlek
|
80
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfszlek
|
81
81
|
:body: |-
|
82
82
|
**Ruby**
|
83
83
|
|
@@ -85,7 +85,7 @@
|
|
85
85
|
- [Part 2](https://github.com/odlp/advent-of-code-2020/blob/main/day-14/part2.rb)
|
86
86
|
:replies: []
|
87
87
|
- :author: gurgeous
|
88
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsa879
|
88
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsa879
|
89
89
|
:body: |-
|
90
90
|
Ruby, 835/440
|
91
91
|
|
@@ -94,14 +94,14 @@
|
|
94
94
|
https://gist.github.com/gurgeous/eeeef7c3760ae2825d93313912ba83ab
|
95
95
|
:replies: []
|
96
96
|
- :author: frontpageminus
|
97
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsctyo
|
97
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsctyo
|
98
98
|
:body: |-
|
99
99
|
Ruby 3481/2141. I wasted a lot of time before I realized the issue was that `x | y & z` != `(x | y) & z`.
|
100
100
|
|
101
101
|
[paste](https://topaz.github.io/paste/#XQAAAQBFBgAAAAAAAAARiAqGkkN7pUjVWW5QMRJorQl/iGDTuz7z9FE7Z0PROHdaroTicEU21UyHqu+JbrZn/hZVJVA0o7+hBbTdOUtULU7YRXF8ZeND/yP8nUt4GSQfvvOXxsFQUu/S5kfezPDFrh8UVeGBywu+Tsmdm7fBw/uebQWn/OUtkuYg7pHYif7HYE7mdq8/UAD4eq2xCKQyvq2NM0CBnu3tEjr3TVSA1kOA6B7qA5WjP0tZ97QjNG2BZjb7WLwYybRXPUvvIhvTcA+BYUb/rAwCQ1xaXVeNSug586eu8fuubIYzf0bet9YM7slUvq9poS7RtWlyWGwf5jeyqVRANHxDOP2Ld7Ff7ADXIQizNkgUWLumY0EpNhaEOgJ/AOKDKZa9+LjcBFNjwUHauibFBwvf+be2oiIlh+ZjmEmpg727tnfrQv6zqPeJJbDm62MMs9OzGEUqOuledDjU2nyYBErjYW6TVg2gFSLYml9xxC+4ogHkICymn/Yfm3q8LFxLNO7eI0TigZ96KfOlhD+C5UV14iJ0VBynrG4PRs+YM82sZVUKFp04tHy3wbhp1kidYRiM2MOI2rp05732v3+EsqeodL6KHPjc3hHCjLmaRJykTDaoWv3TwoGV1M2al3YHbAvIyd8BmeU5cBd41ZTMK8uFFRlUDpCiOHD+wpC1kQ3ZQSTq7QZE4iwj/b8VoA==)
|
102
102
|
:replies: []
|
103
103
|
- :author: CodeIsTheEnd
|
104
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsdyft
|
104
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kcr1ct/2020_day_14_solutions/gfsdyft
|
105
105
|
:body: |-
|
106
106
|
**Ruby:** 11:43/26:41, 489/470
|
107
107
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: "[deleted]"
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/ggir6ki
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/ggir6ki
|
4
4
|
:body: |-
|
5
5
|
**Ruby**
|
6
6
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
[https://gist.github.com/Clashbuster/722338797dc16958652f7c3980accb4d](https://gist.github.com/Clashbuster/722338797dc16958652f7c3980accb4d)
|
12
12
|
:replies: []
|
13
13
|
- :author: a_a-a_a-a_a-a_a-a_a
|
14
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gg01f77
|
14
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gg01f77
|
15
15
|
:body: |-
|
16
16
|
Ruby
|
17
17
|
|
@@ -24,18 +24,18 @@
|
|
24
24
|
Should prob have extracted the logic into a single method and passed the constant number in, but didn't get around to it yet. Still working on day 12/13 part two so no time for clean up.
|
25
25
|
:replies: []
|
26
26
|
- :author: billiamthesecond
|
27
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfymal1
|
27
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfymal1
|
28
28
|
:body: |-
|
29
29
|
[Ruby](https://www.billiam.org/advent-of-code/15.html)
|
30
30
|
|
31
31
|
My first pass took some number of minutes to complete for part 2, but poked around with performance a bit afterward. Down to ~6 seconds, mostly by making the lookup hash and key local to the loop.
|
32
32
|
:replies: []
|
33
33
|
- :author: skawid
|
34
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfyf8iw
|
34
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfyf8iw
|
35
35
|
:body: "[Ruby!](https://github.com/simonbrahan/aoc2020/blob/master/day15/main.rb) Completes in eight seconds; it did this well first time, now I have to go back over it and figure out which bullet I accidentally dodged today..."
|
36
36
|
:replies: []
|
37
37
|
- :author: odlp
|
38
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwxfs9
|
38
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwxfs9
|
39
39
|
:body: |-
|
40
40
|
[Ruby solution](https://github.com/odlp/advent-of-code-2020/blob/main/day-15/solution.rb):
|
41
41
|
|
@@ -59,7 +59,7 @@
|
|
59
59
|
```
|
60
60
|
:replies: []
|
61
61
|
- :author: gurgeous
|
62
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfw85v5
|
62
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfw85v5
|
63
63
|
:body: |-
|
64
64
|
Ruby, 528/291
|
65
65
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
https://gist.github.com/gurgeous/5636fd2e267bc7ae1ecf9224be20bbf2
|
69
69
|
:replies: []
|
70
70
|
- :author: Krakhan
|
71
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwjtu5
|
71
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwjtu5
|
72
72
|
:body: |-
|
73
73
|
# Ruby
|
74
74
|
|
@@ -77,11 +77,11 @@
|
|
77
77
|
[paste](https://topaz.github.io/paste/#XQAAAQA5BAAAAAAAAAAnFUW8WzF1WEoJx9V0hOKfg4NcZ7Zk7SRGQT3OQ36ywk0b08L95+2OES2ZqZtizraLudliFIMNvbVWpu4eDd9rzrUL+J/wZrn7LhHMNeiNqmsLCdXKt8JUUG7FeOB187Wsq17adijbYQbNj5riEPzV9JGbyFJcEhr6pwsBVJDwCad8B+Ss9dpFLh+Y8Gbuu5f4M7Xn4ZA92rzErIdR9NEZhWeoeLetfmk2cw0stsCS7AK4JHuN2JFCczsmBTe6ca6JMngpGcRqoeoCCPxDmwniojEEiZqVSxNFYwmbg+GfP5Vht3Gx2qzALrJ/cjmOEyGiJ3KxgqohCY7OoFw6sNYS0E20dtjAJng5tyANJOFbIRN5uLeR2BJJ2WjrMFqpZLP+8o0gr7OttvxHUAJQpi+wwSg3T2uTrt+b4mdcI6Fr4wwhIlZC5pNIQMf0dYFVp/Odga++r9Qq5Jpb/Xh+rQBPvkHemisxG3Dgr16vrzwqRtwUzVZcxkt818hqW87j7UkKdYD6WZ94+6Y5XqW6lhhQQiGaqSD/BtV9AA==)
|
78
78
|
:replies: []
|
79
79
|
- :author: "[deleted]"
|
80
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfw80xr
|
80
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfw80xr
|
81
81
|
:body: 'Ruby: [http://ix.io/2I7f](http://ix.io/2I7f)'
|
82
82
|
:replies: []
|
83
83
|
- :author: CodeIsTheEnd
|
84
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwcejk
|
84
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kdf85p/2020_day_15_solutions/gfwcejk
|
85
85
|
:body: |-
|
86
86
|
**Ruby:** 13:11/14:11, 927/351
|
87
87
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: "[deleted]"
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/ghogxmi
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/ghogxmi
|
4
4
|
:body: |-
|
5
5
|
Better late than never. Kinda overengineered. Ended up using a matrix transpose for the second part.
|
6
6
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
[https://github.com/izaguirrejoe/AoC2020/blob/main/Day16.rb](https://github.com/izaguirrejoe/AoC2020/blob/main/Day16.rb)
|
10
10
|
:replies: []
|
11
11
|
- :author: Krakhan
|
12
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg4h48g
|
12
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg4h48g
|
13
13
|
:body: |-
|
14
14
|
# Ruby
|
15
15
|
|
@@ -18,29 +18,29 @@
|
|
18
18
|
[paste](https://topaz.github.io/paste/#XQAAAQAzBwAAAAAAAAA5GUqKNoFH6SMqoVC09YUYlYrjjNB8HNCAJ2iwkNLh9g1eeWZnbDThi7et4cKyVjQoO6JtbMbEDJrVZQmYsm3hDg8vXoCnlqQyqJ5kVDFYCnzWt64eTZ4sJSA+hbZ48OLbN3iBDBWJLcIANNNqeDLMqkbtdgPmdsfPvNJM3roTJy3j6SCNE9uL0HrcN02iueu6quMei4RU9sN/e2EnVw0aNQ/Zmc6KC1ePEx+HT/CAFECShK3jvhdsAlTATOYSOycse4bPVfrqiS6fECL4eAnrlyiwQKsQeXMdybRyOCKjUANTeSjQWZTsHI56tJ1Fih4/k9MbYL7bdanfTh8o5bw2/gfM5n9cszF6cGN/Wz0CtGkPiPh3sDq65ju+L/N6Pp8mLY0ZJ8xv214t+IpqPucOBu+G8lmkQZ//CxNH+jUL1LqieXY3zDyIi+hwZ1+BfnAGbKsDVCvFC29r99dSnT4vlY5EvPcYGb+p9rmbauSyl5gGCzDyQPdbg69EpFsnp4/fO3xy5WHMnzYNOE4v7dYcqWYmQpXYU9zDWGwmt+CopNeqAIKAkg6ydPdZFQ9OrclQP0VmB+XaqBSeG5BZwUAfyPJTId5Tjrn6lgnQpVc9ov0L0TJ+/xxE3vnSz7mcfx8n6qdqgvvBp5NfsmEZhybkmnFgtwMH84cs7tdTA7QBnV29SELe+hrYmRK0Ng7ubJdeszpHy2cPVuBZ9GZSIzSU52bOEOFZ2XeEnqQZl+57tvNhgaYRtR2Ngi39jEI82aqxE4VT6tvVcY+8Bl34y1xCs43Zo/81R7uf59hzPFKRsvI04CaiOs7It5OXqy7R/MHaimh+231dovIbCP4ER/dbg83rDb5NA3c9TKRodvMjUP4prETflGoq76bDKiZe3Hh0MlRJp+PUrpeuHSeh9jeIsM24oIa/yb2wuYhSrFnDab3RD02Hd0ZXo7uS5jRlbsB08jHnKfsLhoz0ZWixWwd7zTcYl716qEmUX1icupyBszDydaOESbBHpqes7txypkBO6AM2YoUZn+2Cv37grC0tgUAGQI6DUecCBpPRK5hgI8UxgqsAOxD6X6wYgqX/2WXxSA==)
|
19
19
|
:replies:
|
20
20
|
- :author: ForkInBrain
|
21
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gglge3m
|
21
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gglge3m
|
22
22
|
:body: I think you just got lucky. I instrumented mine and it had to retry about 90 times. Looking at your code, I think we had a similar algorithm.
|
23
23
|
:replies: []
|
24
24
|
- :author: mattaman101
|
25
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg35lfy
|
25
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg35lfy
|
26
26
|
:body: |-
|
27
27
|
# [RUBY](https://www.codepile.net/pile/Vm7EWVY9) Part 2
|
28
28
|
|
29
29
|
Using hashes with a key of the rule (route, price etc) and a value of sets containing indexes in the ticket that it cannot be. A pattern emerged and these sets were of length 19 - 18 - 17- 16- 15 etc etc. You look at the length 19 set and see what index is missing, and assign that as the correct index of that sets key in a new hash, and then add that missing number to all of the sets, since now none of them can be at that index. Keep checking the length 19 set (since the length 18 one is now 19, and the former 19 one is now 20) and eventually, you get all of the correct indexes.
|
30
30
|
:replies: []
|
31
31
|
- :author: skawid
|
32
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg2wh9j
|
32
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg2wh9j
|
33
33
|
:body: |-
|
34
34
|
[Ruby!](https://github.com/simonbrahan/aoc2020/blob/master/day16/main.rb)
|
35
35
|
|
36
36
|
Keep finding ticket columns with only a single valid rule, until you have all the columns. My original solution (breadth first search) is still running.
|
37
37
|
:replies: []
|
38
38
|
- :author: prophetjohn
|
39
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg1wyls
|
39
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg1wyls
|
40
40
|
:body: "# RUBY\n\n[https://github.com/j-clark/adventofcode/commit/29225aa85fe56909fa2cdd19fb30c68537f79d46](https://github.com/j-clark/adventofcode/commit/29225aa85fe56909fa2cdd19fb30c68537f79d46)\n\nI just hacked it as naively as I could think of and it worked and was definitely not my slowest solution \U0001F937♀️"
|
41
41
|
:replies: []
|
42
42
|
- :author: CodeIsTheEnd
|
43
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg09e24
|
43
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg09e24
|
44
44
|
:body: |-
|
45
45
|
**Ruby:** 9:13/23:45, 300/153
|
46
46
|
|
@@ -49,7 +49,7 @@
|
|
49
49
|
This one was great! Super fun. My favorite yet. Thankfully Eric made Part 2 "easy", but it still would have been fun even if we had to "search" for a solution. I don't mind getting to bed a little earlier though!
|
50
50
|
:replies: []
|
51
51
|
- :author: gurgeous
|
52
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg05zvr
|
52
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg05zvr
|
53
53
|
:body: |-
|
54
54
|
Ruby 147/124
|
55
55
|
|
@@ -58,14 +58,14 @@
|
|
58
58
|
https://gist.github.com/gurgeous/9ceb70393345c2233b3923647d3095d6
|
59
59
|
:replies: []
|
60
60
|
- :author: billiamthesecond
|
61
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0ag9a
|
61
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0ag9a
|
62
62
|
:body: |-
|
63
63
|
# [Ruby](https://www.billiam.org/advent-of-code/16.html)
|
64
64
|
|
65
65
|
Nothing too fancy, and none too fast
|
66
66
|
:replies: []
|
67
67
|
- :author: rhardih
|
68
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0hlnq
|
68
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0hlnq
|
69
69
|
:body: |-
|
70
70
|
Ruby solution to part 1 with a bit of meta programming:
|
71
71
|
|
@@ -90,7 +90,7 @@
|
|
90
90
|
```
|
91
91
|
:replies: []
|
92
92
|
- :author: shandley256
|
93
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0snlr
|
93
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0snlr
|
94
94
|
:body: |-
|
95
95
|
# Ruby
|
96
96
|
|
@@ -101,10 +101,10 @@
|
|
101
101
|
Both run in ~150ms. Disregarding load/boot time for Ruby it's more like 15ms.
|
102
102
|
:replies:
|
103
103
|
- :author: petercooper
|
104
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0ueh2
|
104
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg0ueh2
|
105
105
|
:body: Like this. Very idiomatically Rubyish solution. Mine was somewhat messier (though `Array#transpose` came in handy – a method I've never needed to use before).
|
106
106
|
:replies:
|
107
107
|
- :author: shandley256
|
108
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg1g51h
|
108
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ke2qp6/2020_day_16_solutions/gg1g51h
|
109
109
|
:body: "Ah nice! Thanks \U0001F601\n\nI didn't think of using `transpose` ... did you post your solution somewhere?"
|
110
110
|
:replies: []
|
@@ -1,17 +1,17 @@
|
|
1
1
|
---
|
2
2
|
- :author: skawid
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6savt
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6savt
|
4
4
|
:body: "[Ruby!](https://github.com/simonbrahan/aoc2020/blob/master/day17/main.rb) Lots and lots of `for` loops."
|
5
5
|
:replies:
|
6
6
|
- :author: shandley256
|
7
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/girz1c6
|
7
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/girz1c6
|
8
8
|
:body: |-
|
9
9
|
Thanks for sharing! I based a solution on yours: [https://github.com/seanhandley/adventofcode2020/blob/master/ruby/day\_17/advent17.1.rb](https://github.com/seanhandley/adventofcode2020/blob/master/ruby/day_17/advent17.1.rb)
|
10
10
|
|
11
11
|
With a bit of recursion I folded the nested loops which means part 2 can re-use the same methods: [https://github.com/seanhandley/adventofcode2020/blob/master/ruby/day\_17/advent17.2.rb](https://github.com/seanhandley/adventofcode2020/blob/master/ruby/day_17/advent17.2.rb)
|
12
12
|
:replies: []
|
13
13
|
- :author: prophetjohn
|
14
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6h0zn
|
14
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6h0zn
|
15
15
|
:body: |-
|
16
16
|
# Ruby
|
17
17
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
Took about 40 seconds to run both 3 and 4 dimensional boards
|
21
21
|
:replies: []
|
22
22
|
- :author: odlp
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6900i
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg6900i
|
24
24
|
:body: |-
|
25
25
|
**Ruby**
|
26
26
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
- [Part 2](https://github.com/odlp/advent-of-code-2020/blob/main/day-17/part2.rb)
|
30
30
|
:replies: []
|
31
31
|
- :author: gurgeous
|
32
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg441pn
|
32
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg441pn
|
33
33
|
:body: |-
|
34
34
|
Ruby, 109/148
|
35
35
|
|
@@ -38,22 +38,22 @@
|
|
38
38
|
https://gist.github.com/gurgeous/f9710ea2bf307d624091ab39089ae50f
|
39
39
|
:replies:
|
40
40
|
- :author: akanet
|
41
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg4c2i3
|
41
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg4c2i3
|
42
42
|
:body: 'Ruby makes it really nice to produce a solution that''s totally independent of the dimensionality of the input: https://gist.github.com/vincentwoo/40dbaa939c8622dfd739a4a716e7f4c2. Maybe you''ll enjoy.'
|
43
43
|
:replies:
|
44
44
|
- :author: gurgeous
|
45
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/ggb69qn
|
45
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/ggb69qn
|
46
46
|
:body: |-
|
47
47
|
Ooh, that's really good. I always forget about product. I also like your usage zip/sum for the directions. Very nice. If only I could remember these helpful methods in the heat of the moment...
|
48
48
|
|
49
49
|
A friend also reminded me about minmax, which I had forgotten.
|
50
50
|
:replies:
|
51
51
|
- :author: akanet
|
52
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/ggc5t8h
|
52
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/ggc5t8h
|
53
53
|
:body: oh! never knew about minmax, beautiful
|
54
54
|
:replies: []
|
55
55
|
- :author: CodeIsTheEnd
|
56
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg4ffob
|
56
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg4ffob
|
57
57
|
:body: |-
|
58
58
|
**Ruby:** 9:51/12:21, 82/78
|
59
59
|
|
@@ -62,14 +62,14 @@
|
|
62
62
|
Leaderboard just before my birthday!! I could have done even better but I had `map = {}` instead of `map = new_map` at the end of my loop and didn't realize for a minute.
|
63
63
|
:replies: []
|
64
64
|
- :author: frontpageminus
|
65
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg502uf
|
65
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg502uf
|
66
66
|
:body: |-
|
67
67
|
Ruby ~10000/~9000. I’m pretty sure this is the first time I’ve ever gotten to 9 levels of indentation before! I’m only pasting part two, part one is basically the same minus the `w` layer.
|
68
68
|
|
69
69
|
[paste](https://topaz.github.io/paste/#XQAAAQCjCAAAAAAAAAA2GEuY6cXZ7/uZzpDbNO7U3qiTUxzax9bflR4aP2V3CxO5RMNcOFdMcD1bxJubz5g/D2p2Nmqgs2xCvcrIHHwyvW2QgzPaACuzPoostwqAqrTT3lr0pWT/KQju94V+YvjT26BlzQgfLd0scZGehQ+hd2DY5xNFzbtTJAGMR8sTSe3tSQVyZuCvFIgFx1yV3oRO2JJyR9PWeupttsGagxwvlcWg388jnutaOLT2AFgAQcg5MoLLaz8+61grJ+W/12OKeR20poTSiOKd5Oy2oh8pUfebhD9TLPKcSWgtElJb6KQ1wI9LgLfek7osOlLLNJYfpjb0muLwVU35KxEfYPI4xEq6ehhG3HCnakXGkmWTJGl4C/Exr7j87/oKl+AtHKwZ67pm7nPKX8I7YUBjnwYvzNzKlO/3r8z3HqlcQB+1a0V2XFznQNGCydoa4iB+bZ+fMCr6HNQFw5j4aOwU4or9Za8u1beLFCp5/oujySG4BDXiAsEWdYCkcrSLCxthy9oUZXHO+5yCO3JkxlZO0DlP0bFjg40uZZA34DulrzZT2GqWV3heF34xu+StuAl6Z9XzkXkw/jqN45oS23ofSblU9XVvCa8ERqSgK8gz6B8JN3kYOmFiTHHpAUof2ST7UnvfRNzc81xKG5/PSIF2jTYiIuPHC5Cshf/gEifJb6bJf6aF6tXZiqmZkmpYbKSRY3WnjgnKvXa7f6KxkrkhoykqsYv2LpYlGxHxLIwURgaF5tfu2Kxgnx4A6Lve1GPzo5UneCyGFAOeU4eEzGJ0jtSzt2KSv+yjh3Mdxampqa1f2IWjc/Gv/6rH0aDuJBz/GSVH2gg4D9LBUF8lIyn2i/CSgon3n1UNYohhGj91inexx0qhSQ3uZ4KL/SPbnw==)
|
70
70
|
:replies: []
|
71
71
|
- :author: "[deleted]"
|
72
|
-
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg5hdz6
|
72
|
+
:url: https://www.reddit.com/r/adventofcode/comments/keqsfa/2020_day_17_solutions/gg5hdz6
|
73
73
|
:body: |-
|
74
74
|
Ruby, object-oriented approach: [paste](https://topaz.github.io/paste/#XQAAAQC8FAAAAAAAAAARiEJHiiMzw3cPM/1Y611SZZzCokqVQwRwyl1Nd0tAtOAWiRF+WWRZFs5wa3uzVXnVnYiky0sL6lwFW4YOzIaq4LPRJbgvFwTH3ic16lIt51zUitKTLvpWBNIOJBcQHHaGA7TqVHHXXhgRkr6zTDw2BToufD+/bJHXXEkseUruweDKqMs0wCCB2EHQ+m+1ysYkXd2NVszXTB3ovvXnKqvpMEkBeTHNGl1ajz2JfQFIyQdKvYMfacB3P4soEmbIADo59jyj/2RmlcjvB9H/wDiPh8pCLr3rGHazEOmWpfE2G77sjmsHIWyO9rfuP8zmZb1eMh4s6fTmnVDefiRps77M8OXpQR7ORhDJ3GOqivkJQCgtjMS+JBKhS6ZGLZmS+E74tY+BaHNFE3S3JOMCDuoHxDN+Cin1Vt9EcVJRb122Tw4hvWEErU4qtxgdIndHJjXZbJENJXOXKb6bkxpkbVdvvQBAUkDL26xvRYGHTJnWYlMwgHgApr2VTdepFgWsyrOg+vPCm9GNSOe7QYdiuc921H77gZP2ybw9mwRF+DrV2OEp0uIdx9nyaeoy23I7XIdbK64Fwq1sfagmeRo4v9s8GSS+slhZBDeuS2FO/3TgN8B0pcAvVJeHzP+ayRWQ1vYDT5Anm5mOVTdZwg+7DaAkTXUSk2uzQ7swj7irZgTtBm/JNJyuOorGaLn0dXFo1X8m6ejDhMOID7782VNup1JUZtMyr/XGXnXxU0FAZux9ssR0PsBfq0PqZ2IA+cuDyVnS6HvzrGxXdpdjp2DGovhX20xSD6gr/PfM/WUAf1Eaxf9+8N5YsUuO+ubY34NPk6g157oHncqGh4EQs3Skt3UvTjd1PTJZk5EH0u4m7Xt+gRnykNh1e+3KgeeY5tUGMmYIARSbEX5jY4k7lPdjGQwwBnVB7oksqzQ5fgMqZljt5jgoTCm2dE79FJrbcb4tzT2pFwyYv3dCXazGvbpgl5HeOJ8MlHXperbJgs9CLvlnLU4QWndygUPaCei8qL8THd/CtmoZ7uNrzKrIYdTZS4NYjIojv0cD+t0Vurpag9smJDdQzKknBfALm/pOLaXCSle4ApWuLxz3GdLURCFJayHCZ7FZaG3z/MB6Sq5hfNzIcp2J1T8O5V1CuW9KP7B8mx1ObcwzZFKA3bOmM9WhNbvRRIzEGSWJzfvljq6e5CgHR95+JmHqXAZ0kUcElUTBbo+0jHeJjsJqT2LRVMqBU6LSvuk/iSOSZXEYunRrsRkj1CW3qPwtkuyRIqdbTdBTe0khV30crPIxmZXsTWLJ/A+uKYZ1md+Y4Taq3eckvd9NRfLUeXLhq5D6V65iR4n57b6krXMVHh14hUb0PXIS7GBV+8+vy7V/zQQBH0S0rRwGy2/Ys9KgHff81xbwRaJLc1AGEmV25bZiUnCv0QlsGDI+5hOoODFuMUGjxUtX+YlZJ/sUKsima7V1H5sGs4nt3Wka1eOxi4cms+S1Qp7BiAdEuxYZHsfSoxjbjL5NV6zIc7XNwqZjnPhI4EUeRkDIim8vR/OFLuN68fcmVLrq5ATEOp5f+Y1GSbCLdH/bQS2kzmVBvxb1A6bb4iVy10708JrGQjRk4DDe6JQDt5VsBAjcZXO6xv6JrWCG0kEoW8S6PDzKo3cTHW7SlmyNv03/2mEV/g==)
|
75
75
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: billiamthesecond
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/ggbs034
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/ggbs034
|
4
4
|
:body: |-
|
5
5
|
# [Ruby](https://www.billiam.org/advent-of-code/18.html)
|
6
6
|
|
7
7
|
I struggled a bit with part 2 and then just did it with regex in a loop that wouldn't handle other operators or rules.
|
8
8
|
:replies: []
|
9
9
|
- :author: damyvv
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/ggao1o3
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/ggao1o3
|
11
11
|
:body: |-
|
12
12
|
# Ruby
|
13
13
|
|
@@ -35,7 +35,7 @@
|
|
35
35
|
```
|
36
36
|
:replies: []
|
37
37
|
- :author: Krakhan
|
38
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg9xkc7
|
38
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg9xkc7
|
39
39
|
:body: |-
|
40
40
|
# Ruby
|
41
41
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
[paste](https://topaz.github.io/paste/#XQAAAQD9BQAAAAAAAAAilgYjwtWpSjoK7ZXFJt80jYPP3IxfbZ+qKhk6siCMDvFu5qxBhCrx/N+iUTnxs5HHTt6ONcgTjliaD7X5aLtYQfDhmm+vqguU2F7qhD2VDdV/Xl3gS+lwh3kkiuk9wTrDM0WaXyZTJX5k1uskG87cSrqYHABY8tn0mapauhERx/MGiPlGES5DivZExo8dhujcZTJC0X2Nkj9Z6xvXgWDcT4cR7deW+3oaI09sY3nbbv3Er3H7YF1Ic/9UBtdEOhrCwnFrrMVY7b70KYwh0eYort2+eyugvWaLdMxopLxW3i/qUE/2gKUkqyFiAwPDZcXaf5jHWbey2p2gUSKJNjN2hth4qWeUrEuMZ1zkERFWBa7/YpIw7n59NQbPfYIc/U843p7OlqUZ7Kj/B9zFRT6QCEPh9W2oDIk8XuLy3lavOeki52mNL8UnCmEp0ARsJ5DocCoJLoPwlPK1Xj0lQDuzZmvTcOSEyyYoJoZmSP53Wnn6Ca5roK26WGnqTBSCbVErUsCYJUrxdqxTFC+NnBU7HuBZJAMBPHUYrFACWWpAoK+eqr2PzS5gEuKEkKsN7SdSirZ+WHxxqoOgJUyqDN+Mf10kb1XoGraE4RDGbVfEGfHqH1893VG8SdqvaPA6e6lyvszdSVCJJe6gKPFsOZQwZDMkMb9FFE/sHkraK1HwjW0jhrX/ThRUt4f8d/XZMFs3btqSL+bJ/b1AUo1phaSNRfzCdcOWi0VgmeInQtlARI6NQFV8PscAHf/1vrJt)
|
45
45
|
:replies: []
|
46
46
|
- :author: paileyq
|
47
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg812h9
|
47
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg812h9
|
48
48
|
:body: |-
|
49
49
|
Thankyou Ruby for letting me redefine operators!
|
50
50
|
|
@@ -63,11 +63,11 @@
|
|
63
63
|
```
|
64
64
|
:replies:
|
65
65
|
- :author: valtism
|
66
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg87vt4
|
66
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg87vt4
|
67
67
|
:body: bruh
|
68
68
|
:replies: []
|
69
69
|
- :author: ndnenkov
|
70
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg81ply
|
70
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg81ply
|
71
71
|
:body: |-
|
72
72
|
Ruby
|
73
73
|
|
@@ -99,11 +99,11 @@
|
|
99
99
|
That moment when... the metaprogramming in your language is so strong that it feels like cheating. xd
|
100
100
|
:replies:
|
101
101
|
- :author: frontpageminus
|
102
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg84lvj
|
102
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg84lvj
|
103
103
|
:body: Wow, this is genius. Never would’ve thought of doing it this way.
|
104
104
|
:replies: []
|
105
105
|
- :author: jschulenklopper
|
106
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8nfl2
|
106
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8nfl2
|
107
107
|
:body: |-
|
108
108
|
**Ruby**
|
109
109
|
|
@@ -133,7 +133,7 @@
|
|
133
133
|
```
|
134
134
|
:replies:
|
135
135
|
- :author: Sharparam
|
136
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8q2xv
|
136
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8q2xv
|
137
137
|
:body: |-
|
138
138
|
A tip: That `reduce` call is the same as just doing a `sum`:
|
139
139
|
|
@@ -142,15 +142,15 @@
|
|
142
142
|
```
|
143
143
|
:replies:
|
144
144
|
- :author: jschulenklopper
|
145
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg93mq5
|
145
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg93mq5
|
146
146
|
:body: Yes, that's even better. Thanks. See if I can change that in the original post.
|
147
147
|
:replies: []
|
148
148
|
- :author: el_daniero
|
149
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8qbpp
|
149
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8qbpp
|
150
150
|
:body: Hey, I did [almost the same thing](https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8oy0d?utm_source=share&utm_medium=web2x&context=3). I tried overloading the operators in Integer, but tried to swap them directly and ran into trouble when I wanted to sum them. It worked out in the end though – my ["cleaned up" version](https://github.com/daniero/code-challenges/blob/master/aoc2020/ruby/18.rb) is very similar to yours, but using `**` to correct the precedence for part 1 didn't occur to me. Nice one
|
151
151
|
:replies: []
|
152
152
|
- :author: Unihedron
|
153
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg82rcr
|
153
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg82rcr
|
154
154
|
:body: |-
|
155
155
|
Ruby 19/30
|
156
156
|
|
@@ -177,14 +177,14 @@
|
|
177
177
|
```
|
178
178
|
:replies: []
|
179
179
|
- :author: wholarry
|
180
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8463r
|
180
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8463r
|
181
181
|
:body: |-
|
182
182
|
[Ruby](https://github.com/dgokman/advent_of_code_2020/blob/main/aoc_2020_18.rb)
|
183
183
|
|
184
184
|
Fun with monkey patching!
|
185
185
|
:replies: []
|
186
186
|
- :author: CodeIsTheEnd
|
187
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg87tvv
|
187
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg87tvv
|
188
188
|
:body: |-
|
189
189
|
**Ruby:** 19:55/28:52, 705/601
|
190
190
|
|
@@ -193,7 +193,7 @@
|
|
193
193
|
Gah, just awful. I TA'd a compiler class in college and a whole lot of good that did me! After nine minutes I still hadn't even come up with a sensible approach and deleted my code and started over. Blah. Though I actually do like my approach for Part 2: an expression without parentheses can be evaluated by splitting on ` * `, then eval-ing the addition parts and multiplying them together.
|
194
194
|
:replies: []
|
195
195
|
- :author: WholeWheatBagels-
|
196
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8c4mk
|
196
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8c4mk
|
197
197
|
:body: |-
|
198
198
|
# Ruby
|
199
199
|
|
@@ -202,14 +202,14 @@
|
|
202
202
|
https://github.com/detjensrobert/advent-of-code-2020/blob/master/day18/day18.rb
|
203
203
|
:replies:
|
204
204
|
- :author: meh9083
|
205
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8mk99
|
205
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8mk99
|
206
206
|
:body: |-
|
207
207
|
Ingenious!
|
208
208
|
|
209
209
|
I would not have been surprised if something randomly broke even just in the few functions you still call.
|
210
210
|
:replies: []
|
211
211
|
- :author: el_daniero
|
212
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8oy0d
|
212
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg8oy0d
|
213
213
|
:body: |-
|
214
214
|
Quickly rejected the idea to write a grammar in Antlr and went for a quick and dirty one today
|
215
215
|
|
@@ -252,14 +252,14 @@
|
|
252
252
|
```
|
253
253
|
:replies: []
|
254
254
|
- :author: parentheses-of-doom
|
255
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg96kpl
|
255
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg96kpl
|
256
256
|
:body: |-
|
257
257
|
[Iolang](https://twitter.com/prajjwalsin/status/1339944793460199426).
|
258
258
|
|
259
259
|
Inspired by the Ruby solution this is in reply to. In IO you have complete control over the operator table, so its trivial to do something like this.
|
260
260
|
:replies: []
|
261
261
|
- :author: frontpageminus
|
262
|
-
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg84988
|
262
|
+
:url: https://www.reddit.com/r/adventofcode/comments/kfeldk/2020_day_18_solutions/gg84988
|
263
263
|
:body: |-
|
264
264
|
Ruby ~2000, ~1200. Enjoyed this one!
|
265
265
|
|