Grokking Oracle Coding Interview
Ask Author
Back to course home

0% completed

Vote For New Content
One small way to improve the answer provided in this challenge is doing away wit...

CaptainKidd

Nov 5, 2022

One small way to improve the answer provided in this challenge is doing away with the memory array to tell where you've been before. There's no need for it. Just mark the node as something other than 0 or 1 to mark that you've been there.

So for example mark the nodes you've visited with a value of 2 and then do a check grid[x][y] == 2 and if that's true you can return 0 in the recursive call. Saves a little time and memory.

4

0

Comments
Comments
L
lejafilip a year ago

And you fail interview because you can't change the input.

On this page