Ad
  • Custom User Avatar

    You can break it by setting the input array to have length of 0, and this will pass all the random tests.

    The random tests are broken.

    Example is in my solution.

  • Default User Avatar

    It does not work if the random array length is 5. ;)

    Do not modify the input array (see comments above).

  • Default User Avatar

    I think your code does not work. The array length can be up to 100 in the random tests and if the length is greater than 5, your code calculates x-x (== 0).