Beta

Simple Fun #351: Gallup

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    This comment has been hidden.

  • Voile Avatar

    As usual about floating point errors, using floats to represents numbers that has a specific decimal significance (which is needed for the task) is a bad idea.

    At least they should be changed to strings.

  • JohanWiltink Avatar

    I am regularly off by one. One of the testcases that my solution would fail is

    Test.assertEquals(gallup([23,17,7,10,8,34]),86);
    

    Honestly, I did not feel like figuring out to the last decimal who's right and who's wrong.

    You may want to add that as a fixed test.

    But I have already submitted. :P

  • ZED.CWT Avatar

    This comment has been hidden.