Testcase 15 - perf-test-4 failing

Only my perf-test-4 is failing, i checked the previous post, but it didn’t resolve my issue.
P.S: i am using Java

You have downloaded the perf case right?

yes i have downloaded it, and tested locally on my machine, it is giving stackoverflow error due to deep recursion i guess.
Can you tell me how can i optimize it more or the issue with my code

  • You are going in four directions which is wrong. You can only move right or down.
  • Why are you making a cell unvisited after visiting it. If you keep them visited, it tells you whether you can reach destination from this cell or not. If you can reach then you have got the answer, else you can’t reach using this cell and there is no point in visiting it again.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.