Way of looking at it


So effectively we are filling up a memo table of size RC, so complexity is simply O(RC). This is how i did it. Is it relevant?


Yeah I think so it works! As far as we keep in mind that it’s the reason because of which no already chosen path will be chosen again (as we are checking if memo[r][c] != 1)