Merge pull request #1 from sidaksohi/sidaksohi-patch-1

Update number_of_islands.rb
This commit is contained in:
sidaksohi 2021-08-22 21:42:21 -07:00 committed by GitHub
commit 2d3aaaf4a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@
#DFS, Recursive Bottom Up Approach - O(n^2) Time / O(1) Space
#DFS, Recursive Bottom Up Approach - O(n*m) Time / O(1) Space
#Init num_of_islands = 0, return if the grid is empty
#Start a double loop with index to iterate through each plot (each value is a plot of either water or land in this case)
#if the plot is land, dfs(grid, x, y)