Ad
  • Custom User Avatar
  • Custom User Avatar

    Passing the first seven test cases. Any hints?

  • Custom User Avatar

    Did you code in Java before? This is almost overkill. It's nice, but it's overkill.

  • Custom User Avatar

    :c doesn't appear in the first round at all, thus, you may end up not even keeping track of its votes. Thus, you should make sure you count the votes for all candidates even if they don't appear in the first round. Anything not appearing in the first round should be removed, anyway.

  • Custom User Avatar

    Interesting. Can you explain what exactly is going on/why this works?

  • Custom User Avatar

    This line:

    Test.assert_equals(order_weight("2000 10003 1234000 44444444 9999 11 11 22 123"), "11 11 2000 10003 22 123 1234000 44444444 9999")

    Wouldn't the correct response be "11 11 2000 22 10003 123 1234000 44444444 9999"? Because 22 and 10003 have the same digit number, but 22 should come before 10003 like 11 comes before 2000, but it doesn't in the test. I feel like this is contradictory. @g964

  • Custom User Avatar

    The test file in Ruby seems to be contracdictory in the second test.

  • Custom User Avatar

    I love ternaries as much as anyone, but using them like that just makes it seem like you're trying to lower your line count. It ends up being a lot going on in 3 lines. Takes away from the simplicity.

  • Custom User Avatar

    The line n -= 1 is completely unnecessary, as dividing on the next line will return an integer with no remainder.