Ad
  • 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?