The goal of this puzzle is to find in a grid groups of adjacents water cells and compute the size of the surface or lake. You can use a flood fill algorithm to traverse the grid and memoization to store the state of each cell in the grid for reusing it later.