Ad
  • Custom User Avatar

    I've properly checked your code now that I'm on a pc, check my updated answer.
    This is the input that makes your code fail: strip_comments('apples, pears # and bananas\ngrapes\nbananas !#apples', ['#', '!'])

    Use this to see what your code is doing.

  • Custom User Avatar

    I ran your code against the codewars test and observed the input and it wasn't what you showed, and your code did absolutely fail that test, which I confirmed by hand and not only through the cw test message.

  • Custom User Avatar

    You're also not running the same test case as the one that codewars is running when it gives you a fail. (And if you had to guess the input instead of finding out what it was, then you're already aware of this to some degree)

  • Custom User Avatar

    Your code fails when there is more than one marker in the same line. Not a kata issue.

  • Custom User Avatar

    Please read the description again, carefully.