Ad
  • Custom User Avatar

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

  • Default User Avatar

    Very much so! We should avoid processing unnecessary data, especially when the problem itself points out that the input array might be very large.

  • Custom User Avatar

    Oh, and if you are still not convinced, please tell me which test case you think is wrong and I'll take a look at it.

    Thanks again!

  • Custom User Avatar

    You should probably check the test case you failed a bit closer, I can (almost) promise you that they are correct. (1500+ successful solutions.) Note that the description explicitely states that some things you need to figure out from the test cases.

    To give you a nudge in the right direction, you could start with a minor adjust for isMerge('ab', 'ab', 'b') which should return false. After that you probably need to rewrite your solution to handle isMerge('banana', 'bana', 'an') which should return true.

    Thanks for providing your code, it makes it much easier to answer.

    Thanks for taking interest in the kata and good luck! :-)