Skip to content
RED SAG Skills
hard20 pts · first answer countsarraystwo-pointers

Why rain water two pointers move the lower side

In the O(1)-space trapping rain water solution you keep leftMax and rightMax and move the side whose max is smaller. Why is that safe?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions