Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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 classSolution
will be created.In your solution,
main
is a function of objects with the classSolution
, but it isn't a function of the class itself.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
('..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.