Java Static Initializer Block

  • + 2 comments

    Your answer is fail to pass the 6th test case.!!

    image

    • + 1 comment

      Sorry. It should be "if (B <= 0 || H <= 0)". You can try again.

      • + 0 comments

        It is the same thing. And Answer comes by this.

    • + 1 comment

      Test 6 is testing for the upper bound of < 100. If you look in the constraints you will see that the number entered must be greater than -100 and less than 100. The test is failing because it tests a height of 100. The crazy thing that is missing is they do not tell you what should display when this situation happens. But what it is expecting is the exception that you get when your height or breadth is negative.

      • + 0 comments

        @catequil Thanks, you are right. But the constrains are actually: -100 <= B <= 100 -100 <= H <= 100

        So the 100 should be included. I guess it's a mistake that Testcase 6 fails, when you take the input 100 for valid.