Question: PYTHON HW #4: Arrays and Strings / 4. Question 4 Saved DESCRIPTION GRADING 16 MY TEST 1 Given a list ist with non-negative integers where

PYTHON
PYTHON HW #4: Arrays and Strings / 4. Question 4 Saved DESCRIPTION
GRADING 16 MY TEST 1 Given a list ist with non-negative integers

HW #4: Arrays and Strings / 4. Question 4 Saved DESCRIPTION GRADING 16 MY TEST 1 Given a list ist with non-negative integers where each represents the heights. Find two heights, which together form a container, such that the container contains the most water and return the area. Helpful visualization of problem. 8 7 6 5 4 - 3 2 1 0 Example: Ist - 11.8, 6, 2, 5, 4, 8, 3, 7] (same as diagram above) -> 7*7 = 49 Ist - 11.1] -> 1*1 = 1 ist - 14, 3, 2, 1.4) -> 44 - 16 ist - [1, 2, 1) -> 1-2 = 2 Note: Test Case 16 tests efficiency. If it fails try a different approach. - Tip: Make sure that you're not printing anything! It slows your solution down code.py New 1. def most_water(1st): 2 pass Full Screen

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!