Complete the code to initialize the maximum area variable.
int maxArea = [1];We start with maxArea as 0 because initially we have no container area calculated.
Complete the code to calculate the width between two pointers.
int width = [1] - left;The width is the distance between the right and left pointers.
Fix the error in the condition to update maxArea with the larger area.
if (area [1] maxArea) { maxArea = area; }
We update maxArea only if the current area is greater than the maxArea found so far.
Fill both blanks to move the pointers correctly based on height comparison.
if (height[left] < height[right]) { left [1]; } else { right [2]; }
If the left height is less, move left pointer forward; otherwise, move right pointer backward.
Fill all three blanks to calculate area and update maxArea inside the loop.
int area = Math.min(height[[1]], height[[2]]) * ([3] - [1]); if (area > maxArea) { maxArea = area; }
Area is height of the shorter line times the distance between left and right pointers.
