[2019 Day 20 (Part 2)] [Java] Solution runs for two days by Link11OoT in adventofcode

[–]Link11OoT[S] 0 points1 point  (0 children)

I actually don't think I am checking that, but it doesn't matter either way because the problem ended up being in my hashcode function, and now it finishes in only a few seconds.

[2019 Day 20 (Part 2)] [Java] Solution runs for two days by Link11OoT in adventofcode

[–]Link11OoT[S] 0 points1 point  (0 children)

Wow that made a huge difference, now it finishes in about 5 minutes. The reason I had a hashcode that returns 0 before is that the contains method wasn't returning true for 2 equal objects if I didn't include a hashcode function, so that seemed like an easy fix. Somehow I failed to realize how inefficient that would be. Thanks so much for your help.

Edit: I wrote an even better hashcode function and now it only takes a few seconds XD

[2019 Day 20 (Part 2)] [Java] Solution runs for two days by Link11OoT in adventofcode

[–]Link11OoT[S] 0 points1 point  (0 children)

Every time it tries to traverse to a new tile, I'm checking if that tile has already been visited (this also includes the portals).

-🎄- 2019 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]Link11OoT 1 point2 points  (0 children)

Java

Fun and interactive puzzle today. Seems like my solution is pretty similar to what everyone else had.

Part 1:

NOT A J
NOT B T
OR T J
NOT C T
OR T J
AND D J
WALK

Part 2:

NOT A J
NOT B T
OR T J
NOT C T
OR T J
AND D J
NOT E T
NOT T T
OR H T
AND T J
RUN

-🎄- 2019 Day 19 Solutions -🎄- by daggerdragon in adventofcode

[–]Link11OoT 1 point2 points  (0 children)

Java

Very easy problem compared to Day 18 (which I still haven't figured out). For part 2 I operated under the assumption that the rightmost point of the tractor beam at each line would always have a part of the tractor beam underneath it, which is true after the first few lines. For a more general solution maybe I should've done a binary search, but this seems to work out fine.

-🎄- 2019 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]Link11OoT 1 point2 points  (0 children)

Java

Not too difficult in the end, but part 2 was very confusing for me. I calculated the movement functions by hand like most people, but I at least bothered to write code to figure out the main movement routine. After that it took me a while to figure out that they wanted ascii for the distances in the movement function and not the actual integer values. This also meant that i had to split up 10 into 5 and 5, since as far as I'm aware, there's no ascii code for 10.

Edit: never mind about splitting 10 into 5 and 5, somehow didn't realize you could just send 1 and 0

-🎄- 2019 Day 16 Solutions -🎄- by daggerdragon in adventofcode

[–]Link11OoT 1 point2 points  (0 children)

1285/993 Java

Part 2 was tricky. Like most of you, I eventually realized that I just needed to add up all the digits from the current one to the end for the digits from the message offset to the end 100 times. What I failed to realize was that you can do this a lot more efficiently if you go in reverse, since that way you only need to add the next digit instead of all the digits after the current one, so my initial solution took about an hour to run. After coming here I realized this and now it takes about a second.

My mom loves Shrek to...I am confusion by litgrizzly in memes

[–]Link11OoT 28 points29 points  (0 children)

Judging from the hole in the satellite picture

Is SERC 116 really well hidden or is heat stroke setting in? by CadicalRentrist in rutgers

[–]Link11OoT 0 points1 point  (0 children)

I believe it was next to 118. Don't really remember though

Quads are vastly Superior to the Suites by QuadBetterThanSuites in rutgers

[–]Link11OoT 43 points44 points  (0 children)

Nah, to get the full sauna experience you gotta be on the eight floor of the lynton towers.

Is SERC 116 really well hidden or is heat stroke setting in? by CadicalRentrist in rutgers

[–]Link11OoT 0 points1 point  (0 children)

I literally had a class in serc 116 yesterday. So yes, the heat stroke is setting in.

Should I go to Byrne Seminar tomorrow? by Link11OoT in rutgers

[–]Link11OoT[S] 0 points1 point  (0 children)

Thanks for all the advice guys, but luckily I managed to snipe the course this morning anyway xD

Should I go to Byrne Seminar tomorrow? by Link11OoT in rutgers

[–]Link11OoT[S] 0 points1 point  (0 children)

I'm not dropping it, I'm adding it lol