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.
i dont remember, but the language was Javascript
I don't get what the issue is here. The
n
is at index 1 in the first string (the longest in your example) and in the index 0 of the second one. What do you mean with what your wrote?Where do you see that, in which language?
Resolved in latest fork.
You must add a test that forces you to continue rotating turns even if one of the robots does not attack. In this example must be win Robot2, but if you only change round when it was attacked had been produced, in that case robot 2 only excute one of all attacks, and how his attack is less he lost. My initial code worked whitout change round if attack is not produced and pass the all test when i tryed 2 or 3 times.
Add a test that looks like this example and returns that robot two won. Don't leave it to chance...
2/2 A subsequence must be delivered in order. You can say on the instructions that you want it not to be ordered, or it is, or this is and that is not, it is your choice. That you cannot do is require in the test that the string is ordered if it is made up of numbers and not if it is made up of letters without saying anything about this on the instructions...
TWO ISSUES
1/2 - You must add that although they do not have to be consecutive, they must maintain the direction towards the end of the array, that is, if the first matching term is at index 3 of the longest string, the second cannot be at an index less than 3 ... Your instructions lead to error, non-consecutive does not imply that it must have an address, and you require it in LCD("anothertest", "notatest") ...
Friendly reminder: It's more declarative use a block instructions "if", "else if", "else". That a triple nested of ternaries on a one line.
This comment is hidden because it contains spoiler information about the solution
Input array can be mutated by user in random tests.
Just do one
it
block for random tests and call the test in a loop for 20 times.added
You're right, I should start with a comma, however since the element's primitive type shouldn't be a problem I've removed that paragraph. Thanks to comment!
I feel like that may be the duplicate of one of the existing katas, although I'm not sure.
Also the phrase
It can contain anything but it will always be an array.
is a bit confusing, since it's not clear which types may be there (strings, numbers,null
,NaN
, objects, functions...)