Ad
  • Custom User Avatar

    This is a common issue in randomly-generated test cases. To generate a random number using Math.random(), there needs to be a lower bound (included) and an upper bound (excluded). However, since numbers in JS are doubles, they start losing some precision after a certain point. This will, in very rare cases, cause the upper bound to be included. If you're interested, you can take a look at MDN's explanation here: Math.random() - JavaScript | MDN.

  • Custom User Avatar

    Sometimes the submission tests all pass and sometimes a single one fails. I'm assuming the arrays are randomly generated, so I'm not sure how to reproduce this. When it did fail, it was off by 1