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.
yes, the intial solution sorry. It had wrong tabbing in my case.
What do you mean? Preloaded section isn't visible to the user. Are youa ctually talking aboiut the initial solution?
Python preloaded has wrong tabbing
Karcott, Yes, very sorry about this. FArekkusa helped ne recognize this. I think I might have added that intially, then when writing the actual function forgot about it. I have removed this statement. And, not to be rude, but your example should of never happened as 2 players cannot have the same coordinates. But I see what you mean. Thanks for the feedback.
Help do what? Realize that you don't know basic geometry? Euclidean distance, manhattan distance, chebyshev distance - all of these completely different formulas can be used to calculate distance between 2 objects on a cartesian plane - are you suggesting that we're supposed to immediately know which one you used? I'd agree with you if you used euclidean distance which actually makes sense with your backstory, alas you're living in an alternate reality where people are moving in zig-zag at 90 degrees angles.
@ TheProCoder The main problem with your distance calculation is that when there are more than one players at the same distance distance away, you return only the last one in the dict. But the description seems to say that it should return how many players had the same distance.
If you need an example think about this:
coordinates({1: (3, 3), 2: (5, 5), 3: (3, 3)}, (2, 2))
. Which player is the closest? Well player's1
and3
are both 2 units away, which is the closest. So the correct solution should either be something like a list of numbers ([1, 3]
), or the way the description used to have it was to return the number of players that tied (2
). BUT your solution at the moment does none of these, and instead returns the last player3
.It isn't a problem with us visualising it, but a problem with the description, and with your solution.
how can you fix a kata to not become a duplicate ?!!!! and nothing was fixed thooo (You should not resolve issue without fixing them ~~
If you think about the basketball court as a Cartesian Plane, then it will help. Say if Max is at 20, 13, 20 being his x coordinates and 13 being his y. That sentence basically means how many points (remember - Cartesian Plane) Max is away from each player.
If it is too confusing, tell me if I should remove it. Thank you for your valuable feedback!
Sorry, except for the random tests (I am still working on that), I have fixed everything. Thank you for the helpful links which I will definitely utilise in the future.
Not only the explanation is terrible, but it is also completely wrong...
The actual task is to return the last player in the dictionary among those who have the minimum distance to Max.
This comment is hidden because it contains spoiler information about the solution
This sentence makes no sense. Neither euclidean nor manhattan distances work (I even tried chebyshev distance), what's the correct way to calculate the distance then?
No random tests
Performance tests do not test for performance at all (you can just remove it or generate bigger inputs)
Close duplicate and other related katas
You should read more info here && here
So sorry. My clumsy mistake. Thanks for informing me: I have set an intial solution now.
The initial solution is still the default template one.
Loading more items...