Errors in Test Data


  • 32
    M

    In the statement, it says
    "Each rectangle is defined by its bottom left corner and top right corner"

    However, there are test cases like

    Input: -2, -2, 2, 2, -3, 3, -4, 4

    Which is wrong, because there are no rectangles with bottom left corner (-3, 3) and top right corner (-4, 4).


  • 17
    M

    Agree with you so much and another case '0, 0, 0, 0, -1, -1, 1, 1', I think, is wrong,too, because the first is just the original point, not a valid rectangle.


  • 0
    H

    can't agree more


  • 0
    C

    I think this is okay.


  • 0

    This is fixed, sorry for the inconvenience.


  • 0
    M

    A rectangle of area 0


  • 0

    While I at first didn't see a problem with such a "point rectangle", partly because I saw our rectangles as the Cartesian product of two intervals in ℝ, I do after some digging agree that it's bad. "Rectangle" literally means "right angle". And I don't see any angles in a single point. Definitions I've seen also mention the angles (and sides) right away:

    Mathworld's first sentence:

    A closed planar quadrilateral with opposite sides of equal lengths a and b, and with four right angles.

    Wikipedia's first sentence:

    In Euclidean plane geometry, a rectangle is any quadrilateral with four right angles.


  • 0
    D
    This post is deleted!

  • 0
    M

    Well, for most problems which have string input, the interviewer looks for edge cases were the string is null or empty. Technically, you are asked to do something on a string with characters that is provided to you, and you still have to take those nulls and empty cases into consideration.

    For this problem, assume one of the rectangles are missing (the only way to represent this is make left bottom corner and right top corner coincide to become a point, considering the input parameters). Yes, this is the 'BAD' test case!


  • 0
    M

    I know you clearly. Thanks very much.


  • 0
    C
    This post is deleted!

  • 0

    Hey, I'm also まどか☆マギカ fan, nice to meet you.


  • 0
    O
    This post is deleted!

  • 0
    N
    This post is deleted!

  • 0
    V

    @mbyd916 said in Errors in Test Data:

    Agree with you so much and another case '0, 0, 0, 0, -1, -1, 1, 1', I think, is wrong,too, because the first is just the original point, not a valid rectangle.

    Agreed, a nasty case to get around to get accepted.


  • 0
    This post is deleted!

  • -1
    V

    @mbyd916 said in Errors in Test Data:

    Agree with you so much and another case '0, 0, 0, 0, -1, -1, 1, 1', I think, is wrong,too, because the first is just the original point, not a valid rectangle.

    This test case is still out there. Ridiculous.
    The focus is not the original point can or cannot be treated as a rectangle.
    The overlapped area of a point and another rectangle should be 0. Not 4 as "expected".


Log in to reply
 

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