Ad
  • Custom User Avatar

    Hacker πŸ’ͺπŸ”₯

  • Default User Avatar

    megaultrastrong πŸ’ͺπŸ’ͺπŸ’ͺπŸ’ͺπŸ’ͺπŸ’ͺπŸ’ͺπŸ’ͺ

  • Default User Avatar
  • Custom User Avatar

    Ого πŸ’ͺπŸ’ͺπŸ’ͺ

  • Custom User Avatar
    // first round
    {
      'Abelt Dessler': 1,
      'Reinhard von Musel': 1,
      'Lex Luthor': 2,
      'Drake Luft': 2,
      'Brian J. Mason': 0,
      'Frank Underwood': 0
    }
    // second round
    {
      'Abelt Dessler': 1,
      'Reinhard von Musel': 1,
      'Lex Luthor': 2,
      'Drake Luft': 2
    }
    // third round
    { 'Lex Luthor': 3, 'Drake Luft': 3 }
    

    After the second round:

    • the elimination of Abelt and Reinhard from the first voter puts Lex at the first place of the first voter β†’ +1 for Lex;
    • the elimination of Abelt and Reinhard from the fifth voter puts Drake at the first place of the fifth voter β†’ +1 for Drake.
  • Default User Avatar

    I realized that Abelt and Reinhard are eliminated after the second round and Brian and Frank are removed after the first round, but in the third round, 2 votes for Lex and 1 for Drake, so why is it a draw?

  • Custom User Avatar

    The third round is 3:3 Lex/Drake (Abelt and Reinhard are eliminated after the second round). Hence the undefined.

  • Default User Avatar

    Yes, but anyway in the third round 5:4 Lex/Drake

  • Custom User Avatar

    The second round is 3:3 (Lex/Drake). (Edit : Abelt and Reinhard are removed from all voters after the first round.

    Edit 2 : Brian and Frank are removed after the first round. And the second round is also 2:2 (Lex/Drake).

    Note to myself : don't reply in the evening.

  • Default User Avatar
    [   ['Abelt Dessler', 'Reinhard von Musel', 'Lex Luthor', 'Drake Luft', 'Brian J. Mason', 'Frank Underwood'],
        ['Drake Luft', 'Lex Luthor', 'Frank Underwood', 'Brian J. Mason', 'Reinhard von Musel', 'Abelt Dessler'],
        ['Drake Luft', 'Reinhard von Musel', 'Lex Luthor', 'Frank Underwood', 'Brian J. Mason', 'Abelt Dessler'],
        ['Lex Luthor', 'Drake Luft', 'Frank Underwood', 'Brian J. Mason', 'Reinhard von Musel', 'Abelt Dessler'],
        ['Reinhard von Musel', 'Abelt Dessler', 'Drake Luft', 'Lex Luthor', 'Frank Underwood', 'Brian J. Mason'],
        ['Lex Luthor', 'Brian J. Mason', 'Frank Underwood', 'Abelt Dessler', 'Drake Luft', 'Reinhard von Musel']  ]

    It should work for random inputs too - Expected: undefined, instead got: 'Lex Luthor'

    in the first round 2:2 between Lex and Drake, then 1:1 between them in the second, and in the third 2:1 in favor of Lex, why should there be a draw? Most likely I didn't understand the condition. help please.

  • Default User Avatar

    hm. That's true.

  • Default User Avatar

    I don't think this is an Issue, since the solution to any kata can be found on the Internet.

  • Custom User Avatar

    fixed.

  • Custom User Avatar

    It's better now, but the input size should be reduced. 50-characters-long strings is a bit too much IMO, and the arrays containing up to 50 strings is just terrible.

  • Default User Avatar

    Super cool kata. Quite an interesting and unusual idea, I think few people have come up with such a good idea yet. The author is well done.

  • Loading more items...