Morgan and a String

  • + 13 comments

    If you passed only the first half of the test cases like I did, and can't tell why, here's the secret: You need to throw a 'z' on the end of both input strings.

    This is definitely one of the worst designed challenges so far. The instructions are vague, the example input and output are easily passed while every other test case fails, and the test cases themselves are all too large to reason with and figure out errors. There is a much more clever and 'right' solution involving suffix arrays, but again, the instructions are vague and never mention a word about them, which discourages research of the topic.

    My suggestion to the problem author is to go over expected logic when letters are equal, because that is where people will struggle with understanding the expectation.