Container With Most Water
Use left and right pointers, compute the current area, and always move the side with the smaller height because only that can improve the limiting wall.
Find two lines that together hold the maximum area of water.
Use left and right pointers, compute the current area, and always move the side with the smaller height because only that can improve the limiting wall.
Use left and right pointers, compute the current area, and always move the side with the smaller height because only that can improve the limiting wall.
Find two lines that together hold the maximum area of water.