Medium · Two pointers
Container With Most Water
Each number is the height of a vertical line. Pick two lines so that the container they form holds the most water, and return that amount.
height = [1, 8, 6, 2, 5, 4, 8, 3, 7] → 49Record your take
Medium · Two pointers
Each number is the height of a vertical line. Pick two lines so that the container they form holds the most water, and return that amount.
height = [1, 8, 6, 2, 5, 4, 8, 3, 7] → 49Record your take