Maintain max[i][j] as the maximum height (with water) for cell i, j. Then using dfs (similar to number of islands) to decrease max[i][j].
i.e. if max[i][j] is decreased then do dfs to check if its neigbhours' max will be updated.
I think the logic is correct, but my code failed on large input, stack overflow.