Click here to see the full article post
No need to have 'seen' set to keep track of visited squares... if immutability of input grid is not important
Agree with @lulutao. The
seen array is not necessary.
@rliu054 In this problem you are right. I thought is the other problem that if input is array of boolean. And we can use 'seen' to get the result in shorter time.
@passeraha array of boolean also can sort without 'seen' .
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.