Ad
  • Custom User Avatar

    Ok. Thanks for the advice. An take your time to let me know.
    I tried with all cases and this the only one that fails.

    But I will do what you suggest me.

  • Custom User Avatar

    The ISSUE tag is reserved for critical flaws with the tests. 718 people have solved this Kata in JS before just fine, so, when in doubt, please use the QUESTION tag instead. As for your question, the code inside your loop needs correction. Instead of focusing on the complicated test that fails, focus on the other more simple test that the solution fails on: f: abcd s: dabcd returns abcd for you when it should return abcdabcd. This is a byproduct of the method you use to calculate indexInSecond.

  • Custom User Avatar

    Yes, the issue resutls from your code misunderstanding the task. The only overlap that this Kata is interested in is between the end of the first string and the start of the other. A string overlapping in the middle of the other doesn't count. As you've noticed, merge_strings('xabc', 'ab') is expected to return xabcab (since no overlap on the edges), and not xabc. Consult the Kata description further if in doubt

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Wow! I've never seen that way of changing more than one variable.