Ad
  • Custom User Avatar

    When writing random tests, is there a better method than having a parallel version of the correct solution, generating testing data, and then passing it through the correct solution. Seems like the globals defined in the Complete Solution should be available to the test code for convenience, but I can't seem to find anything like it in the docs.

  • Custom User Avatar

    Good Point. I've added some random tests.

    I'm not sure if this is the best way to go about doing it, but they are there now. If there's a better way with the tools at hand, I'd love to know it.

    Thanks.

  • Custom User Avatar

    Thank you for replying. I have setup a some random tests.

    If both say '?' then bob has made the same decision as the expert and gets a full point.

  • Custom User Avatar

    "This is not the optimal solution"

    Better to accept the answer and then show them the glory of an optimized solution, or change the message to reflect how an optimal solution behaves. (Your solution uses O(n^2) memory, or something)

    Without more feedback my choices are to walk away from a working but non-optimal solution, or give up to have a look at the solutions to better understand what's being optimized for.

    This is the first question with this kind of test validation I've encountered on this site.

  • Custom User Avatar

    Why did you use arguments[0] in unit instead of an explicit parameter?

  • Custom User Avatar

    Nice! If I'm not mistaken you've gone the extra mile and made it support ES2015 functions too.