Maximum Water Capacity
You are given an array of non-negative integers heights, where each heights[i] represents the height of a vertical wall at position i. Find two walls which together along with the base forms a container, such that the container contains the most water. Return the area of water it can contain.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)