Getting wrong answer

Hello…
I am doing this question from hackerearth…

First of all i have assumed that the 1st row is the ground floor…Now for every column of the ground floor as starting point …i tried to collect chocolate…Now i go up and check for every 3 direction possible and thus i am calculating maximum…Now when i reched the top floor i return from there…This is my submission…Please check it…

https://www.hackerearth.com/submission/51913332/

Don’t know why it is showing wrong answer…Thanks

Hey @ashishnnnnn
Problem in ur code is ,u have mixed local and global N
Just remove the locally declred N

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.