No one has replied
For the second approach, why isn't the time complexity O(nlog(k))?
Aren't you incurring O(n^2) time and space when you call
There are other ways to mark matrix entries as "visited" that don't kill your time complexity.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.