Question: Using PYTHON, You are given an integer list height of length n. The integers inside the list are interpreted as n vertical lines drawn such
Using PYTHON, You are given an integer list height of length n. The integers inside the list are interpreted as n vertical lines drawn such that the two end points of the i-th line(in a cartesian plane) are (i, 0) and (i, height[i]). This is illustrated below in red. Write a function Exercise4(height) such that it finds two lines that together with the x-axis form a container, such that the container contains the most water.
Return the maximum amount of water a container can store.

1i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
