r/programmingchallenges • u/mr-rusof • Jul 02 '18
The Watermark Problem
http://ruslanledesma.com/2018/07/01/the-watermark-problem.html
3
Upvotes
r/programmingchallenges • u/mr-rusof • Jul 02 '18
View all comments
Show parent comment
1
u/mr-rusof Jul 03 '18
Thank you for your feedback. When submitting your solution, it is crucial that it is not only correct but efficient. The run-time of your proposed Ruby implementation is O(n2), where n is the length of the histogram. The expected run-time is O(n).