My output is perfect still showing test case error

please see my code and tell me what should i do as my code is perfectly running

hey @1999atrijsharma
Logic is almost correct :
just a change
int right = arr[0].length - 1; instead of int right = arr.length - 1; ( N!=M pe code fail hoga)
correct code :