Solution to Flood-Depth by codility

25 Sep


Question Name: Flood-Depth or FloodDepth

This is a variant of Trapping Rain Water by LeetCode. The undergoing concept is the same. However, the implementation is a bit different.

5 Replies to “Solution to Flood-Depth by codility

  1. I just want to point out that there is actually an O(N) time, O(1) space solution by using two pointers.

  2. I think my solution concept is easy

  3. Here is my solution and it passes all the tests. O(n) time complexity. And Simple!

  4. My C++ Solution. O(N)

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!