Ad
  • Custom User Avatar

    Agreed and updated. Thanks again!

  • Custom User Avatar

    From your solution, I can see that my problem statement was poor. I have changed "His goal is to reach the highest possible sum of scores for debts paid, thereby reducing the risk of war with as many houses as possible." to simply "His goal is to reach the highest possible sum of scores for debts paid."

    With this in mind, try changing your objective function, and I think you will find the rest of your solution holds good.

  • Custom User Avatar

    Good catch, thank you. Corrected.

  • Custom User Avatar

    This statement feels vauge: "and sometimes undesireable values like empty strings, 0, null, or undefined are stored during the session"

    When you say "values like" it implies that this may not be the full set of cleanups required. It would be better if you were to clearly state that "squeakyClean should return a new array with all empty strings, 0, null and undefined removed".

  • Custom User Avatar

    Confirmed as fixed. Thanks!

  • Custom User Avatar

    I had a similar issue. Wihtout giving too much away (I think), here's a hint. In your testcase, change this:

    output = regex.exec(input);
    Test.assertSimilar(clone.exec(input), output, "regex.clone() gives different results (second iteration");
    

    to this:

    clone = regex.clone(); // this line is new
    output = regex.exec(input);
    Test.assertSimilar(clone.exec(input), output, "regex.clone() gives different results (second iteration");
    

    I believe the tests evaluated on Submission use this strategy, so this may help you debug.

  • Custom User Avatar

    At the time I setup my codewars account, I didn't have an avatar on github. I went and set it one afterward, but it doesn't look like there's any way for me to get codewars to recognize the new one, even if I un- and re-associate with github.

    In this screenshot, you can see that it's pulling the img src from the root of my github account, which of course is not an image: http://i.imgur.com/nSf4ErN.jpg