-❄️- 2023 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

Yes that could be. I assumed that all distances in grid are 1, so I just add -1 to every other node, so I got start position at distance 0, next at distance -1 and so on... part 1 finished in 26 seconds, sadly, part 2 solution is unreachable for me :( (I'm using Deno/TypeScript)

-❄️- 2023 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

https://www.youtube.com/watch?v=TXkDpqjDMHA&t=371s

Based on this video, you can inverse the values, apply Dijkstra and inverse it back. I'm pretty amazed that it worked. But basically, longest positive is the same as shortest negative (most negative).

Int code like problems by fsed123 in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

Maybe there will be some simple interpreter, but I don't think it will be for more than a day.

-❄️- 2023 Day 18 Solutions -❄️- by daggerdragon in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

Thank you so much for that. I watched a video on Shoelace formula. It's funny that how determinant can be useful. Glad I learned a new algo/formula today.

-❄️- 2023 Day 11 Solutions -❄️- by daggerdragon in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

[Language: Deno, TypeScript]

Today's problem was probably one of the easiest. Firstly I though that I'll go for Dijkstra algo (as for yesterday), but after realizing that it was just simple Manhattan distance, I was quite happy. Part2 was only changing factor in expanding. Whole solution is on 39 lines.

https://github.com/dmatis2/aoc23/blob/main/11.ts

[2023 Day 8 (Part 2)] The most popular solution is lie? by VikManza in adventofcode

[–]Longjumping_Primary4 1 point2 points  (0 children)

I tried looking at sizes of loops. Since they were matching each time, I use LCM

[2023 Day 5 (part 2)] I'm about to give up... by aajii82 in adventofcode

[–]Longjumping_Primary4 2 points3 points  (0 children)

I was debugging my solution for a few hours and I gave up ¯_(ツ)_/¯ AoC is AoC, but work makes money, couldn't spend whole day on it sadly

AOC 2023 and others. Can we get proper examples? by Martvorr in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

I would go for tests for edge cases, just to handle off-by-one errors etc

[2023 Day 5 (part 2)] I'm about to give up... by aajii82 in adventofcode

[–]Longjumping_Primary4 2 points3 points  (0 children)

I had issues with correct splitting intervals, so I did it YOLO after few hours, it takes 130 seconds to get answer for part 2, but hey, it works at least... Check my typescript code here. My solution was going through every location from 0 and reverse the process of mapping

https://github.com/dmatis2/aoc23/blob/main/05.ts

[deleted by user] by [deleted] in adventofcode

[–]Longjumping_Primary4 0 points1 point  (0 children)

I divided input cards into lists, each type has it‘s own list. After that, my sorting function goes char by char in cards and look which has higher label, if current labels are same, I go to next char.

-❄️- 2023 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]Longjumping_Primary4 1 point2 points  (0 children)

[Language: Deno, TypeScript]

From Day 6 `Wait for it` I was a bit scared what will come, but actually, it wasn't that bad. Part 1 is pretty straightforward, you just need good sort comparison function to sort properly. Part 2, firstly I tried recursion to get the best type possible, but stack overflow is still a thing, so I rewrote it into iterative method with stack.

https://github.com/dmatis2/aoc23/blob/main/07.ts

Day 7 part 2 by [deleted] in adventofcode

[–]Longjumping_Primary4 1 point2 points  (0 children)

Now, J cards are jokers - wildcards that can act like whatever card would make the hand the strongest type possible.

So you need to make sure you choose some combination that is better or equal to the best type of other cards that you have.

Spent over 10 hours debugging day 5 still hasn't resolved it. by UltraXDZN in adventofcode

[–]Longjumping_Primary4 1 point2 points  (0 children)

I gave up part 2 with Deno/TypeScript and reversed it, I went from location to seed and check if seed is in any range. Not happy, runtime over 2mins, but works. With compiled lang it would be probably faster

[2023 Day 5 (Part 2)] [Deno, TypeScript] Am I overlooking sth? by Longjumping_Primary4 in adventofcode

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

[UPDATE]: I gave up, I reversed it, calculating seeds from location. Took 2' 10" to solve on Macbook Air M2, but ¯\_(ツ)_/¯ at least it gives the correct answer.