Ad
  • Custom User Avatar

    Yes order in floats operations can give different results so I gave an indication:

    With floats it can happen that results depends on the operations order. To calculate hourly speed you can use:

    (3600 * delta_distance) / s

    Anyway nothing can't be modified now since more than 500 guys passed the C++ translation.

  • Custom User Avatar

    Indeed. As an example and possible non-spoiler hint,

    (3600 * delta_distance) / s

    can produce "correct" results while

    3600 * (delta_distance / s)

    can fail tests.

  • Custom User Avatar

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

  • Custom User Avatar

    What a shame. The tests are disastrously bad. I eventually gave up, only to find the "top" C++ solution was almost line for line the same as mine. The difference comes only from rounding differences due to floating point inaccuracies.

  • Custom User Avatar

    You likely forgot to account for the case of an empty array of distances being passed.

  • Custom User Avatar

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