What is the problem with my code?
@tusharnitharwal First thing your array size should be 10051005 instead of 100100 (constraint are of 1000*1000 it is always better to create a liitle big array.)
After moving right you need to check the returned value immediately, if its true return true, then only move forward.
Third when you arrive at n,m first check if this X or not if it is return else print.
If this resolves your doubt mark it resolved.