Expected answer


#1

Hey,
5,0 is giving output 0
and 0,5 is giving output 1
can anyone explain


#2

I think you cannot give 0 as the value of any dimension in the test cases. Giving 0 as the dimension of the grid means it does not exist which renders the question meaningless.