Exercises/#7 Container With Most Water
#7

Container With Most Water

MediumπŸ“¦ Arrays
80 XP

Problem

Given n non-negative integers representing heights, find two lines that together with the x-axis form a container that holds the most water.

Examples

Input: height = [1,8,6,2,5,4,8,3,7]
Output: 49

Input: height = [1,1]
Output: 1
two-pointergreedy
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

7 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features