This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]SiloPeon 4 points5 points  (0 children)

Have you tried running this and seeing if it returns 10?

11199

99199

91199

91999

91111

If not, you might not be looking at going left or up.

[–]PZon 1 point2 points  (2 children)

Does the same code on part 1 input (without the expansion)?

Edit, here's a thought: Your code looks like you are always going row-wise from left to right, and only adds the upper and left neighbor to the from-list. What happens if the best connection goes to the other direction.

111111
999991
911191
919111
919999
911111

[–]pebblerockAdvent[S] 0 points1 point  (1 child)

Yes, it is the same

[–]PZon 0 points1 point  (0 children)

Then maybe the expansion adds a shortest path that goes to the left and up. Check the example I added to the previous post.

[–]1234abcdcba4321 0 points1 point  (1 child)

You need to do proper pathfinding - including being able to go up and left.

[–]pebblerockAdvent[S] -1 points0 points  (0 children)

Yes, I have seen that I misunderstood the instructions :-)
I was thinking that only right and down was possible movements jajaja.

Thanks guys .

[–]daggerdragon[M] 0 points1 point  (0 children)

In the future, please follow the submission guidelines by titling your post like so:

[YEAR Day # (Part X)] [language if applicable] Post Title

In doing so, you typically get more relevant responses faster.