Arrays

Container With Most Water

medium
You are given an integer array `height` of length n. There are n vertical lines such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container with the most water. Return the maximum amount of water.
Hint steps(0/2 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.