Ad
  • Custom User Avatar

    You can forfeit the kata and see other solutions as well as the full code of the kata.

    To help you along a bit, the basic problem is to decide whether it is possible to write the three strings on top of each other as in the description. On top of that there are some more precise requirements added by the unit tests, e.g. if you need to use all characters in all strings, etc.

    When it comes to the empty string tests, there is no special handling required, so there are no special instructions for that case. For example, you can merge an empty string ("") and "apple" to form "apple", so isMerge("apple", "", "apple") should return true. Since you are required to use all the characters (sorry for the spoiler) isMerge("", "a", "b") must return false. With that in mind, what should isMerge("", "", "") return?

    The Banana test is what makes this kata worth 5 kyu instead of 7. :-)

    If you get stuck. Print out the parameters and try to arrange the strings on top of each other on paper, then try to figure out why your code can't. Or ask again. I'll try to nudge you in the right direction. :-)

    Thanks for the feedback and good luck!