« first day (3612 days earlier)      last day (1224 days later) » 

12:48 AM
2
Q: Generate newspaper page number sets

NeilA newspaper is made of several sheets; for the purposes of this question, each sheet of newsprint holds four pages of the final newspaper. Here is an example of three sheets of newsprint making up a newspaper with twelve pages: ___________ |2 | 11| | ___|_____|_ | |4 | 9| |_| ___|__...

 
 
4 hours later…
4:50 AM
10m to AoC!
 
7
 
4
 
You were 15 seconds late!
 
4:57 AM
Yeah :p
 
2
 
intcode 2.0 here i come
 
@ASCII-only Why do you think that?
 
was just kidding
 
4:59 AM
0.5
 
0.25
 
probs another painful input parsing day judging by my luck
 
bruh
i forgot about regex total match i'm dumb
well now i have a 1m wait timer
part 2 is ...
i am going to cry
2/14. ehhhh, not bad. wish i had a better p2 but i don't think i made any critical flaws i'm just slow
 
5:18 AM
I can't do part 1 :(
 
once again
python cheese
you could probably do it via regex in js too
 
How?
It's not regex-y sort of stuff
 
lel i cant do part 1 either
 
@RedwolfPrograms how so?
 
part 1's basically regex tho
 
5:24 AM
I see sort of how it could be regex, but not really
 
i literally converted the rule into a regex pattern and then just matched each string
 
lel
local (global*) scoping killed me
also regex would be easy but too late
 
5:41 AM
star 2 is beating my ass to the point that i almost want to just do a regex translation
 
How would you even do it in regex?
 
might be smarter than trying to make my own engine with fucking generators
 
part 2 looks harder with regex
 
Definitely. First replace is easy, second is technically impossible.
 
i just did a really inefficient match function thing lmao, kinda troll
 
5:43 AM
oh true
it's the fuckin
 
but infinite loop is not really good for regex to handle.
 
literally the textbooxk example not-a-regular-language
@HyperNeutrino the rule 8 substitution would just be adding a +
but then 11 is... not good
 
oh true
wait. maybe you could if you add a bit of an abstraction layer and do 11 via just like matching 42 at the front and 31 behind and then repeat until empty or irreducible
 
Thank you so freaking much for that comment about adding a +, I was using * and would never have found it otherwise
 
that might be how 13 people beat me. idk
oof
 
5:46 AM
lol
 
I just cheated the second replace by trying every possible number of matching ones on either side from 1 to 40
I had a 60kb regex at the end of parsing
 
...lmao
wait yeah that's actually smart. i forgot about that, it's not like there can be infinite matches with short inp strings
hm. wish i didn't immediately assume regex wouldn't work
 
I'm actually working on something similar to this exact thing, basically regexes with variables
 
ooh. sounds like it'd be very useful for parsers lol
 
im still stuck on part 2 lmao
 
5:50 AM
the main thing that's tripping me up right now is i'm getting an answer, just not the right one
 
That way you can do recursive stuff like p:(p)|.+ to match anything in matching nested parentheses
 
im actually so bad
 
...I should try one of the sample inputs
 
tempted to just antlr this shit
or earley
 
mmm, so it matches one more on the sample than it should
...one more?
 
5:51 AM
dude
how the heck to do rule 11
 
erroneously matching aaaabbaaaabbaaa on the example
wish the sample was small and digestible enough to actually follow mentally
 
...one interesting thing I just noticed is that rule 0 is just 8 and 11
 
Would've helped to know that before lol
 
wait
huh
 
5:59 AM
> That's not the right answer. Curiously, it's the right answer for someone else; you might be logged in to the wrong account or just unlucky.
facepalm
 
same happened to me too :D
 
ngn
me too
 
6:16 AM
SAME
had the idea of a greedy sort of algorithm that hardcoded the changes and it actually got the sample right but it got someone else's answer on my real input
hooray for 5 minute timers
i wonder if maybe i'm supposed to find some kind of special relationship between 42 and 31
 
why
 
...i forgot something big
 
i would have gotten this like 10 minutes ago if I hadn't forgotten that line
and/or used smaller toy inputs
that... would have been the main thing
Day       Time  Rank  Score       Time  Rank  Score
 19   00:12:50    75     26   01:25:09  1136      0
maybe it would have been smart to actually follow the challenge's advice and look at the input
 
6:40 AM
ok part 2 is just adding ?R lol
 
yesterday, by Bubbler
Frick
Why is this on the starboard
 
@Bubbler deserves to be there
 
i really need help wth
i match 6 messages on part 2 sample
which is wth
 
hmm, ?R isn't right
 
6:55 AM
@ASCII-only send?
 
@HyperNeutrino link
 
nvm i'm not sure i want to read that
 
>:(
i swear it should work
 
I'm heavily overfitting on the input and trying to finish it with regex
trying longer and longer regex until the answer is accepted
 
so I'm trying to make a useless capturing group to use it later
 
7:03 AM
it's easy with perl regex
and/or java/.net
 
(and also taking longer and longer time)
 
use .net regex and balancing groups
 
Is (abab){0}\1 correct?
 
{0}????
 
Factor regex is even more basic than JS regex, so meh
 
7:04 AM
;_; i'm actually stuck
it's been 2 hours
 
@ASCII-only i don't want it to match initially, I'm just storing it for use later
 
@Razetime that matches it 0 times
aka the empty string
l mao
 
yeah
 
yes
 
i need \1 to reference a previous capture group
 
7:07 AM
since it never matches, \1 is nothing
 
oh well
how do I store a regex pattern smh
aha
named capturing groups
 
????
 
(?<name>(<regex stuff>)\k{name}(even more regex stuff))
 
wth kinda lang has named captures but not recursion
 
Idk how to recurse within a capture group
it's PCRE flavour
 
7:20 AM
i used regex but only to match rule references versus characters
 
DOMAIN ERROR: Too many subpatterns
lol
 
loooool
 
i'm honestly beginning to think regex for p2 isn't the best idea xd
 
it is tho
 
it very likely is
 
7:25 AM
it's a lot easier if you look at the input
 
then again i didn't try it so maybe i should try to do it in pure regex before i judge it
how many of you guys are done
 
can i just give up
i literally don't know which part of it is wrong
 
really wish the provided example covered more edge cases lol
try uh
 
Tried various things but returned back to regex construction
 
0: 8 11
8: 42
11: 42 31
42: "a"
31: "b"

ab
aab
aabb
aaabb
abbbbb
abaab
 
7:35 AM
Let's see if it gives me an answer eventually
 
@UnrelatedString whats this
why is this returning 2 for me
 
a really simple example input you could try for diagnostic purposes
 
Isn't 2 the correct answer?
 
i think it should give 2
 
aab and aaabb
 
7:36 AM
yeah
 
ah ofc.
 
well so your problem is definitely not something obvious lol
 
Looks like a good code golf task
 
tried running this on my own solution:
0: 8 11
8: 42
11: 42 31
42: 31 1 | 1
31: "b"
1: "a"

aab
abbababa
bab
baaaaabab
aaaaaaaaaabbb
and somehow it just straight up errored
 
1 match here
 
7:41 AM
okay now it's 3
 
whats it supposed to return
 
it should definitely match aab, baaaaabab, and aaaaaaaaaaabbb
and the other two should not match
 
ok I'm just going to try recursion now
 
8:00 AM
Actually doing binary search on the answer box would have been much faster
3
 
wait.what?
 
wait how
 
(just tried it, it stops giving me low/high at 4th try and timeout increased to 5min)
I knew they're smart enough to stop that kind of cheating
 
oh wait you mean just brute forcing in the submission
i thought you found a way to divide-and-conquer programmatically lmfao
 
and my program just gave me an answer and the timeout is still 3min left
 
8:04 AM
F
 
ngn
my part2 worked with same code as my stupid recursive part1. i've no idea why. it should have crashed.
 
and the answer was indeed right
 
ngn
congrats
 
but horrible, super inefficient, and super overfitted to the input
 
@ngn my part2 should have worked because of this
but it doesn't
ugh
 
8:08 AM
using plain regex, no recursive regex or anything
 
@UnrelatedString i'm failing on this input but idk why
 
8:23 AM
Looks like the patterns 42 and 31 match 8~10 chars each - could it be more efficient to list all the strings that match them and work on that?
 
8:46 AM
@Bubbler I tried that approach then gave up
but that was mostly because I wanted to try a dumber/greedier version of the same chop-stuff-off-in-a-while-loop approach
and then that version happened to work
@ASCII-only what is the single line that it matches
 
aab lel
 
lol
what if you added uhhhhhh
baab
see if baab matches
 
the last observation was not quite correct, 42 and 31 matches 128 distinct strings of length 8 each, and the two are disjoint
that...makes things definitely easier
 
whatever
i did it
so the problem is i did it wrong
oh well
Day       Time  Rank  Score       Time  Rank  Score
 19   00:26:15   434      0   03:57:57  2956      0
4 hours
i wasted 4 hours of my life for this
 
f
and you still placed under 3000 lol
that made me check the stats page, and there are now more than 10000 people who have completed star 1 on day 4 but not star 2
it's not even hard
it's just
mildly tedious
@Bubbler ...that explains a lot
 
9:14 AM
Using chunks of size 8 indeed gives the correct answer in an instant
@UnrelatedString In terms of (part2 failed/part2 solved) ratio, days 10 and 13 seem to be the highest two, which do require some knowledge in algorithms and/or maths
 
I'm gonna take my time and solve this later
 
@Bubbler I can definitely see why 13 would be up there, but 10 is a bit of a surprise tbh
although I do also remember watching a friend of mine try day 10 star 2 and...
okay yeah 10 isn't a surprise
 
9:35 AM
10 is dp, 13 is crt so understandable
10 is so infamous that it's memed on the discord
 
db, dynamic 🅱️rogramming
 
wait theres an aoc discord?
 
probably not official but yeah what
it's probably run by some people off reddit
 
Wonder if there's some youtube channel who explains how to solve each AOC
 
wait i could do that that's actually an interesting idea
 
9:44 AM
yeah
 
i'd need to figure out how to properly solve things tho
cuz i completely memed yesterday's problem because python funny
 
lol
does python have some way to fuck with precedence or did you just make an int class where addition and multiplication themselves are swapped
(and then also swap addition and multiplication in the input)
 
the latter one
 
nice lol
idk why i thought shunting yard algorithm would get me there faster lmao
 
actually now that i think about it almost all of my approaches use some aspect of python specifically so coming up with a general solution might not even be too helpful
idk should i even bother, cuz i have a decently high rank so idk if people would even be interested if i made videos explaining each solution and how i got to them quickly enough to rank. /shrug/
 
10:01 AM
@HyperNeutrino I agree with memes
 
memes are always best solution
 
I must see it now
 
i don't think i can get it anymore but if i do write up explanations for my solutions i'll send it
 
I just wanna see the messy meme solution
no need of explanation
 
@Razetime tio.run/…
part 2 is very similar. my actual part 1 solution was a sketchy parser cuz i didn't realize i could do this which is why i only ranked 105th
 
10:28 AM
@HyperNeutrino dang. I wrote an entire parser from scratch
Tokens and everything
I overengineered part 2 for that
With three functions: tokenise, bind and evaluate
 
10:58 AM
@HyperNeutrino ok this is hilarious
 
@Lyxal i did too
@HyperNeutrino the method does not affect ranking, it's 99% just the experience + good problem solving
@Razetime link
 
11:25 AM
@Bubbler oh, so everyone gets a different input?
 
11:37 AM
not everyone
but there's enough different inputs to discourage copying answer
 
But you could just copy someone else's code.
 
copying someone else's code is a whole other
thing
 
11:54 AM
@NewMainPosts in case anyone thinking of writing a Charcoal answer, best I could do by porting an existing answer is adapting xash's answer, which takes 20 bytes, but it can be done in 16 bytes, I just don't know whether it's a port because I don't understand some of the answers well enough
 
12:11 PM
@Neil What about retina
 
1:02 PM
@Razetime 48 bytes for Retina 0.8.2
 
1:25 PM
:( i'm not smart enough so my current charcoal solution is 18 lol
17 if i cheat by taking input as python array (so no cast needed)
wait
InclusiveRange is useless since i can just use Incremented???
 
1:46 PM
only for numbers; InclusiveRange also works on character ranges
also, my 16-byter uses InputNumber() so it doesn't matter if the input isn't in JSON format
 
 
1 hour later…
3:03 PM
@ASCII-only eh, true. my strength is speedrunning things that aren't too algorithmically hard which is great for aoc until the problems get harder and i choke lol. so opposite of chat.stackexchange.com/transcript/240?m=56379903#56379903 xd
 
 
6 hours later…
8:33 PM
0
Q: Find the "Bittiest" Number

BipThe Challenge Given a list of integers, the "bittiest" number among them is the one with the most bits on - that is, the largest amount of bits set to 1. Write a function that takes as input a list of 32-bit signed integers and returns as output the "bittiest" number among them. You may assume th...

 

« first day (3612 days earlier)      last day (1224 days later) »