8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26239f9 commit f1152bfCopy full SHA for f1152bf
src/algorithms/uncategorized/rain-terraces/README.md
@@ -109,9 +109,12 @@ The concept is illustrated as shown:
109
110
**Complexity Analysis**
111
112
-Time complexity: `O(n)`.
+Time complexity: `O(n)`. We store the maximum heights upto a point using 2
113
+iterations of `O(n)` each. We finally update `answer` using the stored
114
+values in `O(n)`.
115
-Auxiliary space complexity: `O(n)` extra space.
116
+Auxiliary space complexity: `O(n)` extra space. Additional space
117
+for `left_max` and `right_max` arrays than in Approach 1.
118
119
## References
120
0 commit comments