For those who are not clear with the problem


  • 15
    G

    WA
    Input: [1,2,1]
    Output: 1
    Expected: 2
    Does this mean to find the total "area"? NO

    WA
    Input: [1,2,4,3]
    Output: 6
    Expected: 4
    This is to find the max area between any of two lines.

    You really should refine it a little bit.


  • 0
    P
    This post is deleted!

  • 0
    H

    I still didn't get it. why case [1,2,4,3] should obtain 4?


  • 0
    Y

    if you draw it on paper you will understand - lines 2 and 4 - area will be 4


  • 1
    A

    Thank you - the problem should really be refined.

    I was thinking about the lines are always there, so the [1,2,1] problem look like this in my mind

      |
    |x|x|
    

    Since the middle piece is too tall, one cannot pick [1,3] as a container, one can either choose [1,2] or [2, 3] as a container, and in either case the answer should be 1.

    But the expected result tell me otherwise ... it looks like we are given a bunch of lines, and we can choose two of them to appear so that it creates a container with max area.


  • 0
    S

    Area(4,3) = 3 * 1 = 3
    Area(4,2) = 2 * 1 = 2
    whereas
    Area(2,3) = 2 * 2 = 4


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.