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.

Using PYTHON, You are given an integer list height of length n.

1i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!