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.
Sorry i was noob.
Multiple solutions are possible, so there is no one true solution to show. Showing a solution would be possible, but would give away the kata solution ( there are always ways to peek at that code ).
Closing.
👍
Wow, thank you very much, now i understand where is the problem, i'll fix it immediately
//Update: Fixed it.
For example, I just got a random test with
age = 57
andIHR = 32
.Here
(220 - 57) * 20% = 32.6
, which is greater thanIHR
, and the reference solution assumes that the0.6
portion contributes to the distance as in the safe zone.The core problem is that in your random
IHR
generation, the lower boundMHR * 20%
is by default rounded downwards. If you round it upwards (viaMath.ceil
), it should resolve the issue.Before i removed input validations, there was a condition where, if it's below 20%MHR it would be zero, and i didn't change the final solution because i wrote test cases in a manner where always is gonna give >=20%MHR, so i find strange what you say about "Tests involve cases where IHR < MHR * 20%".
int HR = new Random().nextInt(HRM20/100,HRM)
//HRM20/100 it's the origin parameter, so it can be the minimum parameter.
i looked the other test cases, but i think none of them are wrong, but maybe i overlooked it, if that's the case, please point me out the problem.
//Sorry for the strange english, i can read fine, but i don't write too much
That was for "difficulty" in the beginning, but i should've removed it when i delete input validations.
I will change it now.
Tests with negative speed? Why?
Tests involve cases where IHR < MHR * 20%. The reference solution assumes that heart rates below MHR * 20% are effectively in the "soft" zone. In other words, the reference solution assumes that the soft zone begins at zero heart rate.
I updated it, if you think there's something wrong, don't doubt to tell me.
Okay! thanks for your review, i will modify it now.
Remove input validation.
This comment is hidden because it contains spoiler information about the solution
I think it would be a great idea to inform the user about the solution when it's wrong in the sample tests, which would make the debugging part less tedious
really?
Loading more items...