Ad
  • Default User Avatar

    I think I should have put directly return null below and return new int[]{j,i} inside the if, I forgot to remove the result variable, that way it continues executing the for when it has already found the solution.😅

  • Default User Avatar
  • Default User Avatar

    The first two changes and the last one are done now, the third one now compares the user's response with the one I put in the answer method.

    thank you for the correction

  • Default User Avatar

    Hello there.

    • Conversion to int and then into a double in the random test makes the double params integer every time. You dont need to make the conversions

    • In this case, in your solution use String.format is clearly better than use the implicit cast ""+ and the *100 /100 trick

    • In test case there are 2 methos than makes similar, howMuchWater and answer, only the param types changes. Perhaps both are not necesary (particulary the one than uses int)

    • The original description is too much near the languages, you must add in it a references to java language (not sure about it) or you reformat the description entirety

  • Default User Avatar

    My error was the same and was solved by eliminating the use of the method substring