Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's crazy. I have no idea how anybody can solve this problem in 258 seconds:

https://adventofcode.com/2020/day/20

Did they hope the corner tiles had unique edges and look for those? (which would be unlikely under normal circumstances, considering there are more than a hundred tiles and only 256 different possible edges...)



Funny you mention that, the person who solved part 1 in 258 seconds recorded themself solving that one live: https://www.youtube.com/watch?v=ODUkgEeF7sc


Wow, it took me longer than 258 seconds just to understand the problem statement. I had to read it several times before I understood what "border" meant, as it does not match common usage. I noticed that you referred to them as "edges" instead which would have immediately made sense to me.

It's not just measuring your problem solving abilities but also your famiarity with the author's writing style.


Just curious, what is the difference is between "Border" and "Edge" to you? To me, they are nearly synonyms.

Apple's Dictionary (Oxford?)

> 2 the edge or boundary of something, or the part near it: the northern border of their distribution area | figurative : the unknown regions at the borders of physics and electronics.

https://www.merriam-webster.com/dictionary/border

> 1 : an outer part or edge

https://www.dictionary.com/browse/border

> the part or edge of a surface or area that forms its outer boundary.


While I agree four minutes is very quick, if you take into account that no side fits with more than one other side, and that the sides (#, .) may just as well be interpreted as binary numbers, it becomes an issue of parsing, mostly, and then matching numbers.

I remember being flabbergasted at first, and then realizing the above. My solution is here:

https://github.com/linus/aoc/blob/main/2020/js/day-20/app.js


So it turns out I missed those parts of the problem statement. That makes it fairly easy. I probably still can't write working code for that in four minutes, but it does sound humanly possible, at least.

Also, that's really nicely written code :)


From the problem statement:

> Tiles at the edge of the image also have this border, but the outermost edges won't line up with any other tiles.

So they didn't need to hope; the problem guaranteed it for them.


Ah, sorry, I missed that. That does make it easy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: