Angad Sandhu
Search
Browse

11_Container_With_Most_Water

Source name
11_Container_With_Most_Water.py
# File: Leetcode/Solutions/11_Container_With_Most_Water.py

"""
Problem Number: 11
Problem Name: Container With Most Water
Difficulty: Medium
Tags: Array, Two Pointers, Greedy, Neetcode 150
Company (Frequency): Amazon, Google, Facebook, Microsoft, Apple
Leetcode Link: <https://leetcode.com/problems/container-with-most-water/description/>

DESCRIPTION

You are given an integer array `height` of length `n`. There are `n` vertical lines drawn 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, such that the container contains the most water.

Return the maximum amount of water a container can store.

Notice that you may not slant the container.
"""

Browse the library