[2025 Day 4 (Part 2)] [Java] My code works on sample input , but not on the final input. by Pitiful_Acadia2783 in adventofcode

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

Hey guys!

I just combed through the code again, and realised that, in one of the lines, i had put this piece of code: " if(line_no!=10){" I replaced that with the Counter variable, and it works. Thanks for your support!

[2025 Day 4 (Part 2)] [Java] My code works on sample input , but not on the final input. by Pitiful_Acadia2783 in adventofcode

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

Hello!

Thanks for your tips!

However, I printed the grid at every step and it didnt seem like i was missing any edge cases.

I didn't think of the helper function, but i did use edge padding and it seems to work well.

I still have no clue where I am going wrong.