Not able to pass the test case correctly
The link to the original task https://leetcode.com/problems/where-will-the-ball-fall/
This is my WIP code
The output for this code is
==> -1 ==> -1 ==> -1 ==> -1 ==> -1
But it was supposed to be
==> 1 ==> -1 ==> -1 ==> -1 ==> -1` instead
I don't understand why my code stores -1 instead of 1 at the first index on my array. Could anyone kindly point me in the right direction?2 Replies
What are your grid inputs?
Input:
grid = [[1,1,1,-1,-1],[1,1,1,-1,-1],[-1,-1,-1,1,1],[1,1,1,1,-1],[-1,-1,-1,-1,-1]]