Ad
  • Custom User Avatar

    I have this same problem! both equal 97. both have weights of 5. both score 485.

    As far as I'm aware, Elizabeth comes before Matthew when sorted Alphabetically!

    Any ideas?

  • Custom User Avatar

    It says to sort them in alphabetical order in the case of ties.

  • Custom User Avatar

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

  • Custom User Avatar
  • Default User Avatar

    I think this is probably the best solution here as far as readability, but can you explain to me where the variables "w" and "s" are coming from. I'm still learning, and I don't see themm being called anywhere in the code prior to their use in the return statement. Additionally, if you don't mind explaining, why do you have '-' in front of 'w' in the return statement?

    I appreciate the help, thx!

  • Custom User Avatar

    You need to return the second person, if they're tied, they should be ordered as Elizabeth, Matthew, who's the second person there?

  • Custom User Avatar

    Print the input, why are you assuming things? And this was in the comments below.

  • Default User Avatar

    Ok, I can't understand this. My code (python) works in every single instance except for where the code is telling me it's supposed to be returning Matthew instead of Elizabeth. The system isn't reporting the test parameters to me, so my only assumption is that both numbers have the same weight, otherwise this wouldn't be an issue.

    Elizabeth has a total value of 97, Matthew has a total value of 97, if they're the top contenders and they're tied then Elizabeth needs to be returned, but the test keeps saying Matthew is the correct answer, and that's can't be right. This is the only test that's failing, can someone please help me understand what I'm missing here without referring me to the comments below? I've read them all, the solution isn't there.

  • Default User Avatar

    Had no idea you could chain those . calls, that would have made my solution a LOT simpler.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Good lord, I feel like an idiot. Ok, understood, and changed the one character that made the code not work. I appreciate you calling me out on that, best way to learn.

  • Custom User Avatar

    Not a kata issue, your code is wrong, read this, print the input and see why it fails, the tests are ok, and more than 22k persons passed them in Python. About what's wrong with your code, read the kata title again.

  • Default User Avatar

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

  • Default User Avatar

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