Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.😅
Java Translation
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
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
My error was the same and was solved by eliminating the use of the method substring