Note: You may not slant the container.
- Mehtod1
Most naive way, two loops .
- Method2
- Method3
Suppose two points are s, e. In the beginning, s at the left end, e at the right end. The goal is to maximize the area. So, in this case, we always try to move the shortest bar between s and e to left(s) or to right(e) to look for next bigger area.
No comments:
Post a Comment