Gold Grid Failing 2 test Cases

Its my code is passing only test cases and failing other cases. I am not able to find the mistake in the implementation.

my implementation

corrected code:

if this solves your doubt please mark it as resolved :slight_smile: