Input is a matrix representing the height of each position. Output is amount of water that can be trapped in this matrix.
@heqingy That is right
This is a Google CodeJam APAC test question. Find it here.
This problem has literally been lifted off a SPOJ question (find here).
@pushazhiniao I repeat using the dfs to pour the water into the lowlands and update the new height matrix until the height matrix cannot change (5min30s for the large set based on Python). Someone said you can also use Dijkstra to solve it.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.