You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using your solutions as a reference since day05
So far, your solutions have been the most concise I've seen
I am honestly learning a lot from your work (like indexOf() returning -1 !)
Would you mind putting some comments on your thought process / tips how you construct a solution ?
Or at least comment on the logic of the solution itself
Nonetheless, thank you Sir and keep up the work !
The text was updated successfully, but these errors were encountered:
I'm not sure I can help you with the thought process though. About day 10 specifically I remember that when I read the task, I immediately came up with this stack idea. The rest was just implementing it quickly to see if this works. I usually put test case to the input.txt first to see if result matches problem example and if it does I switch to actual input.
After solving both parts, I usually go to http://reddit.com/r/adventofcode/ to see this day's solution megathread. Oftentimes, there are better and simpler solutions than the one I came up with, so I learn from them too.
Day 10 in particular, there's another way, where you can use regexes to eliminate matching pairs like () repeatedly until there's nothing to eliminate. If the resulting line still contains closing braces, it's corrupted, otherwise it's incomplete. I feel this would be easier to write and maybe even less error-prone, but I didn't come up with it on the spot (which I find odd 'cause I love regexes 🙂). I usually try to compete for time (even when I'm late to the start), so the first solution that comes to mind is the one I put in code.
Basically, it's just some experience with algorithms and general problem solving that helps. I've also been programming professionally for over 20 years and personally since I've been 12, and my favourite subject in high school was math, so it's kinda my thing, you know. 🙂
So good luck for you and keep learning. Advent of code is pretty amazing as a learning tool…
I've been using your solutions as a reference since day05
So far, your solutions have been the most concise I've seen
I am honestly learning a lot from your work (like indexOf() returning -1 !)
Would you mind putting some comments on your thought process / tips how you construct a solution ?
Or at least comment on the logic of the solution itself
Nonetheless, thank you Sir and keep up the work !
The text was updated successfully, but these errors were encountered: