Ad
  • Custom User Avatar

    If you look at the sample tests, you can see how your function is being used.
    Only Solution.main() will be called and no object of the class Solution will be created.

    In your solution, main is a function of objects with the class Solution, but it isn't a function of the class itself.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    ('..C..D..m..',5) — 'Escaped!'
    ('..m...D...C..',6) — 'Escaped!'
    You have a relatively fair point of view though. Firstly I though similarly — if 'D' separates 'm' and 'C' it should always be 'Protected'. But the kata implemented in such a way that if distance between 'C' and 'm' is too big result should be 'Escaped!' regardless of 'D'.
    Last example to clarify: ('m...D.........C', 5) => 'Escaped!'. I hope it make sense. PS. The kata was completed almost 100 times in JS -> It's very rarely that tests are broken in such cases.