recently came across google coding round onsite
- Find number of lakes in atlantic pacific ocean
Given row,col find the number of lakes for given row,col.
Matrix is reprenated by 1' and 0's. => 1 being land 0 being water.
for land 1's find the number of 0's covered by 1's.
Strategy: 1) find land using DFS and keep track of lands pixels
2) for given row,col , if its part of land then go for dfs on land and find the number of lakes by validating and visiting 0's present or not.
Note: forgot to handle edge cases.
veridct : NH
Comments (1)


