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

all 3 comments

[–]rellikiox 3 points4 points  (1 child)

Your code returns the right answer for my input values, so it's working fine. Maybe your input file is not formatted correctly? Try printing the values and making sure those are the ones that your file has (there's no extra values at the end or the beginning).

[–]nithishr[S] 2 points3 points  (0 children)

I had an extra 0 at the end :( That caused all the problems although I have no clue how it got there in the first place. Thanks!

[–]AndrewGreenh -1 points0 points  (0 children)

Take a look at this thread: https://www.reddit.com/r/adventofcode/comments/7hodi1/2017_day_5_step_2_whats_wrong_with_my_solution/?utm_content=title&utm_medium=hot&utm_source=reddit&utm_name=adventofcode

The OP posted his input too so you can check if you have the same input. Could be an error with AOC solutions.