Skip to content

Instantly share code, notes, and snippets.

@pot-code
Last active April 14, 2020 04:28
Show Gist options
  • Save pot-code/01f6878c0a459594eeac5f61dc8df550 to your computer and use it in GitHub Desktop.
Save pot-code/01f6878c0a459594eeac5f61dc8df550 to your computer and use it in GitHub Desktop.
[Array] array related snippets #array #algorithm
m := len(grid)
n := len(grid[0])
for i := 0; i < m; i++ {
dfsClosedIsland(grid, i, 0)
dfsClosedIsland(grid, i, n-1)
}
for i := 0; i < n; i++ {
dfsClosedIsland(grid, 0, i)
dfsClosedIsland(grid, m-1, i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment