Ad
  • Default User Avatar

    yes, the intial solution sorry. It had wrong tabbing in my case.

  • Custom User Avatar

    What do you mean? Preloaded section isn't visible to the user. Are youa ctually talking aboiut the initial solution?

  • Default User Avatar

    Python preloaded has wrong tabbing

  • Default User Avatar

    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.

  • Custom User Avatar

    If you think about the basketball court as a Cartesian Plane, then it will help

    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.

  • Custom User Avatar

    @ 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's 1 and 3 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 player 3.

    It isn't a problem with us visualising it, but a problem with the description, and with your solution.

  • Custom User Avatar

    how can you fix a kata to not become a duplicate ?!!!! and nothing was fixed thooo (You should not resolve issue without fixing them ~~

  • Default User Avatar

    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!

  • Default User Avatar

    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.

  • Custom User Avatar

    Not only the explanation is terrible, but it is also completely wrong...

    If more than 1 person has the same distance away from Max, return how many people have equal distance.

    The actual task is to return the last player in the dictionary among those who have the minimum distance to Max.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The distance from Max for each player should be, how many times does the player have to jump to land on Max's coordinates

    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?

  • Custom User Avatar
    • 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

  • Default User Avatar

    So sorry. My clumsy mistake. Thanks for informing me: I have set an intial solution now.

  • Custom User Avatar

    The initial solution is still the default template one.

  • Loading more items...