Ad
  • Custom User Avatar

    Your code does almost the same thing, but manually checks the difference sign and changes it to positive by itself, which adds extra if statements. They can slow things down a bit, especially if the code is executed many times. Math.abs() will work faster. The difference is minimal.

  • Custom User Avatar

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