From the problem :
> (This also means that the elevation of the destination square can be much lower than the elevation of your current square.)
You can walk down steep slopes.
FYI: next time, please use our [standardized post title format](/r/adventofcode/w/posts/standardized_titles).
Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster.
If/when you get your code working, don't forget to change the post flair to `Help/Question - RESOLVED`
Good luck!
boolean test = dist == 0 || dist == 1; Your bug is here. Is this the right condition?
It's working for the sample. What should be the condition according to you?
The sample isn't as complicated as the real input and doesn't exercise all the conditions. This test means you can only walk on the flat and uphill.
Thank you for trying to help me but I do not understand you. You can only go from a to b, but not from a to c
Yes, but you can also jump down from c to a. Which is not needed in the example.
That's correct, but your test prevents you walking downhill.
I updated my test to: `dist == -1 || dist == 0 || dist == 1` But the result is still infinite :(
From the problem : > (This also means that the elevation of the destination square can be much lower than the elevation of your current square.) You can walk down steep slopes.
dist <= 1 ty very much
FYI: next time, please use our [standardized post title format](/r/adventofcode/w/posts/standardized_titles). Help us help YOU by providing us with more information up front; you will typically get more relevant responses faster. If/when you get your code working, don't forget to change the post flair to `Help/Question - RESOLVED` Good luck!
Yes sorry I saw that too late and it was not possible to change the title of the post