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.
The reference solution expect no errors for
boundaryDistance = distanceToPlayer
, which contradicts what is specified in the description.This is also almost never tested either. There are only 10 random tests (which is too few btw), and no edge case fixed tests to catch this specifically.
hi ^_^ you used .sort() - customers+1 times. What about realy big supermarket with 10^8 of customres and 10^2 tills? ;))) This kata may solved w/o sort anyway
solved();
yeah, i missed it. Thank you for letting me abt it <3 !
Found the flaw: You are missing a
2
in the denominator in yourgetHeight()
method as it containsg / 2
.Ok, that is what I have implemented. An example for a failing random test:
The ball passes the player in
4.105 m
height and drops at76.9 m
so it is clearly score of4
and not of0
.let me have your params.
at first it is necessary to get the total distance of the ball. then if it is lower than player position we can get a result. unless we have to calculate the the height of the ball when the ball at player position. if the height is higher than the player height he cant catch it.
There is an error in your fixed tests. Where 0 is expected, the ball clearly goes over the player. It passes in 4.844m height which is out of reach for the 3m of the player.
Seems also to apply for other random tests where 0 is expected. Or am I getting something wrong here?
Edit: I figured out that in the random tests you calculate the ball passing height not at the fielders position but at the boundary distance.
ok. i'll note that
What is an argument error in this Kata? You either have to specify what the ranges of your parameters are or at least give the rules these values have to fulfil. But I would suggest to drop invalid parameters at all since they add no value to this Kata (and are currently only guesswork).
.
.
You can ask here.
,
Loading more items...