Ad
  • Custom User Avatar

    There are no flawed random tests in javascript, you're either reading the logs wrong or didn't understand something.

    JavaScript Completions 14733

    Read this: https://docs.codewars.com/training/troubleshooting/

  • Default User Avatar

    I spent a lot of time testing and refactoring my code because I kept getting failed tests. I realized that some of the random tests are flawed. There were two random tests that had the same exact customers, but expected different results (wtf?).

    I would check if the incoming customer's change amount would exceed the amount in the register. If it did exceed, I would break out of the loop and immediately return "NO". Why would I need to continue looping through every customer if at least one cannot receive change?