DSAMaster Logo
DSAMaster
BackmediumTwo Pointers

Container With Maximum Volume

Problem Description

Given a list of non-negative integers heights representing the heights of a set of bars with unit width, find the maximum area of water that can be trapped between any two bars. The area of water between two bars i and j is calculated as the product of the minimum height between heights[i] and heights[j] and the distance j - i.

Constraints

  • The input will be a string where each substring contains the height and width of a building in the format "width:height".
00:00
Loading...

Sign in to Solve

Access the full code editor, ThinkBuddy AI hints, and track your progress.

Sign in Free
Test Cases & Output
Enter test input here...
Click "Run Code" to execute