The TransCompilator

Solved LeetCode program · 11 of 1,000

#0011 · Container With Most Water

Medium Array chunk-01.md

Original English source

The heights is a list of 1, 8, 6, 2, 5, 4, 8, 3, and 7. The bestarea is 0.
For every first from 0 to the last position of heights.
For every second from one more than first to the last position of heights.
The width is second minus first. The lowheight is the smaller of item first of heights and item second of heights. The area is the product of width and lowheight. If area is greater than bestarea, set bestarea to area.

Report bestarea.

Open in Playground Browse all 1,000 problems

Expected stdout

49