Complete the code to initialize the left pointer at the start of the array.
left := [1]The left pointer should start at index 0, the beginning of the array.
Complete the code to initialize the right pointer at the end of the array.
right := [1]The right pointer should start at the last index, which is length minus one.
Fix the error in the condition to calculate the container area correctly.
area := min(height[left], height[right]) * [1]
The width between pointers is the difference of right and left indices.
Fill both blanks to move the pointers correctly after calculating area.
if height[left] < height[right] { left [1] } else { right [2] }
If left height is smaller, move left pointer right by incrementing. Otherwise, move right pointer left by decrementing.
Fill all three blanks to update max area correctly inside the loop.
if area [1] maxArea { maxArea = [2] } // Move pointers if height[left] < height[right] { left [3] } else { right-- }
Update maxArea if current area is greater. Then move left pointer right if left height is smaller.
