[2021 Day 8]: Top of the leaderboard upon opening the puzzle

Funny
[2021 Day 8]: Top of the leaderboard upon opening the puzzle

Posted Dec 8, 2021, 10:42 AM UTC

38728
st65763•

I honestly don't understand how someone could have read the instructions and programmed a solution that quickly. For the other problems, I can maybe see it, but this one required so much reading comprehension... The way they explained the puzzle felt so longwinded and yet not very concise

36
Strakh•

I don't know. You can skim a lot of the text:

Each digit of a seven-segment display is rendered by turning on or off any of seven segments named a through g:

[Image] [Image] [Image] [Image]

[Image] [Image] [Image] [Image]

[Image] [Image] [Image] [Image]

Ok, I get that, I know how segmented displays work.

The problem is that the signals which control the segments have been mixed up on each display.

Ah, so I'm supposed to unscramble the numbers. Let's look at what the input looks like:

For example, here is what you might see in a single entry in your notes:

acedgfb cdfbe gcdfa fbcad dab cefabd cdfgeb eafb cagedb ab | cdfeb fcadb cdfeb cdbaf

(The entry is wrapped here to two lines so it fits; in your notes, it will all be on a single line.)

Each entry consists of ten unique signal patterns, a | delimiter, and finally the four digit output value.

(...)

Using this information, you should be able to work out which combination of signal wires corresponds to each of the ten digits. Then, you can decode the four digit output value.

At this point you have an idea of what the problem is. Then you jump to the question and see that they want you to focus on a subset of the digits to begin with.

I am way too slow to solve the actual problem in 10 minutes, but you can ignore most of the text.

14
bunceandbean•

Yeah that's the hard part about puzzles like this. I personally loved it and thought it was super clever, but at the same time it took a LOT of explaining to make sure people understood what was going on.

12
TheTomato2•

Competitive programming. By grinding out problems problems you start to see the patterns of which problems need what solution. They don't just like figure out a novel solution to a novel problem in minutes, they are applying stored knowledge to similar problem to a type of problem they have done a hundred times already. Not that its not impressive, but they generally aren't like super-human genius's or something along the lines that they are just figuring it out for the first time in mere minutes.

3
st65763•

That makes sense.

I'm curious how well this sort of problem solving translates to the real world.

I'd imagine it doesn't necessarily translate well all the time, at least with a competition like this where the only thing that matters is solving the problem before everyone else does. Being the first to solve doesn't mean your code is as efficient as it could be or designed in ways that are easily maintained.

1
TheTomato2•

Being the first to solve doesn't mean your code is as efficient as it could be or designed in ways that are easily maintained.

Exactly that. Its definitely a good skill to have but most code you write isn't going to be implementing algorithms in the first place, most of that stuff is already figured out.

2
sawyerwelden•

Do we have any way to know the time of the winner?

2
reobindev•

The leaderboards mention the winner did both parts in 7 minutes total

8
sawyerwelden•

Damn, 20 minutes gets you on the board. Thanks for the link!

2
fireduck•

It wasn't until I got the second star that I was sure I understood the problem right.

Are all the unique strings on a line from one display and the signal numbers are from the same display (so same mapping of wires)? I guess so. Turns out that worked.

I'm sure it would be more clear if I read more carefully, but ain't got time for that. I need to keep my solid ~1000 rank.

2
ChaiTRex•

It's much easier if you understand the ideas behind the problem ahead of time.

For example, if you've dealt with seven-segment displays before, you basically only need to read the part that shows how they're representing the segments (a through g). You can then skip the rest of the introduction to seven-segment displays, like the diagram of all the digits and the explanation of how 1 has c and f lit up.

If you know about permutations (rearrangements), when they say the wiring is rearranged randomly, you can have a pretty good idea of what's going on. If you've used permutations in your favorite programming language, you're pretty much ready to have your program go through all the wiring rearrangements (there are only 5040 of them) and see which matches up with how the digits are supposed to be wired.

2
j3r3mias•

People ignore the text and just read the examples. If you are used to solve this kind of problems, examples are enough.

1
1vader•

Examples alone definitely don't do it in most cases. But helpfully, all the important information is highlighted, and scanning that is usually enough and can generally easily be done in a minute.

1
Static-State-2855•

My job requires me to use Mandarin Chinese and Spanish. Today it was tough to switch back to English after a bad day at the office and a long commute home.

1
vagina_vindicator•

Got up at 5:40am to try out how it feels competing, at 6am. Not that I have a shot.

Was still reading instructions by 6:30am, just too tired. Gave up and still haven't done it for lack of time.

However! I think just the very last paragraph of part 1, alongside the sample just above it, might be enough to solve it entirely. You'll get stuck on part 2 though.

1
[deleted]•

[deleted]

1
_asdfjackal•

The first half was super easy, the second I have no idea how people did it so fast.

11
AlcaDotS•

I saw in a talk by the organizer that people join who compete in many of these types of competitions. And they have libraries ready to go for most problems.

Also, my solution including comments and white-space is like 100 lines of code. So if you have seen this problem before and immediately know how to solve it, then typing those lines and using those libraries should be quick.

4
wace001•

That’s not what’s going on. Sure people have libraries. But these problems of AoC are unique. I am sure no one have pre fabricated solutions.

Check out https://m.youtube.com/channel/UCuWLIm0l4sDpEe28t41WITA

I love his videos of AoC. You can get a sense of how the pros work.

7
HugeProposal•

Yeah, but you can see in the video he is way more prepared than casual players. Has a script to download the input, ready to go python script to open the input, already importing defaultdict, Counter etc.

4
1vader•

True, but that's it. He doesn't have any other custom libs. And check out some of his older vids. For the longest time, he started out from a blank file, and at first, he even just copied the input manually to a file.

This stuff isn't really what makes him fast. It maybe saves like 5 seconds. It definitely makes a difference during the first few days nowadays with the increased competition but it hardly matters later on once solving the actual problem starts to take longer than a few minutes.

Some people definitely have ready-made libraries for dealing with common stuff like grids, graphs, etc. but it's definitely not as easy as having a ready-made solution and just having to run it or something like that. And you can clearly still compete without all this stuff if you are good enough.

Though he certainly has a very good understanding of common and even some less common algorithms and is very good and fast at recognizing when which would be useful, even if it doesn't solve the problem outright. And ofc he's then also able to quickly implement them from scratch or knows where to find and copy them from on the internet.

2
emu_fake•

They just understood the problem rly fast.. my solution is about <20 lines for both parts, so the time to write the code should not be the problem here

1
TheShallowOne•

This isn't the first problem with this general concept: https://adventofcode.com/2020/day/21

2
MiloBem•

I'm pretty sure there was similar one couple of years ago. People who are very serious about winning this game probably review all previous challenges and have them in libraries ready to reuse.

1
sim642•

Generating permutations and checking each one isn't that much code, especially if the standard library already comes with a function to generate permutations.

1
snamellit•

Giving too much information (aka information overload) is a classic trick to confuse the mind practiced the world over by salespeople and other ilk under the motto "If you can't convince them, confuse them". Dealing with information overload and sorting the chaff from the wheat is also a good skill to train. Kudos to Eric for that opportunity.

11
quodponb•

Today was a reader, but at the same time you gotta appreciate the zany lore

3
Fjodleik•

Interestingly, the leaderboard took twice as long to fill up today, compared to day 8 in the previous 3 years.

2
1vader•

At least for part 2, it also took much longer than the other days this year so far.

But part 1 was still solved very quickly so it's obviously not the reading that was the issue.

1