What's the difference between BFS on grid[i][j] == 0 and BFS on grid[i][j] == 1

  • 0

    I try both methods. But BFS on grid[i][j] == 0 TLE. Is it because in grid, for most test cases, the number of 0 is much larger than the number of 1?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.