Doubt in given code

sol: https://ide.codingblocks.com/s/396615

prob: https://hack.codingblocks.com/app/contests/2022/234/problem

the solution is passing but Im not able to understand how are we able to traverse the grid without using a 2D array.

Hey @raghav007
When u traverse a grid then u use a 2D Array to store/access some value
But u are are traversing only with the help of ur logic not with the help of that array
Its only there to provide u with some info like say u have to calculate cost of each path then u need cost of each tile hence u need that array.

I hope u got my point

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.