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.
Every prime number except 2 and 3 is of the form 6k+1 or 6k-1 , this property can be used to avoid unnecessary looping:)
@Hadron, that is a good summary of the problem. Can you suggest a more helpful wording for the error message?
This looks like a case of the instructions not being followed to the letter.
'If one or more of the opponents pieces are sandwiched by the piece just played and another of the current player's colour...'
Emphasis on 'just played'.
In the play sequence that both MariusAFT and jkranking refer to, neither of the adjacent pieces are 'just played'.
Instead, white has cleverly inserted his piece between two of his opponents previously played pieces, rendering his piece safe.
It caught me out too. If I'm right about the reason then this specific error message might need revising as it's misleading.
Good kata, however.
Hi @hovacink. I've just checked the test in the four languages and are working well. Python may experiment being timed out once in ten attempts. For the other versions the runtime is under 3500 ms. Hope that you can solve it.
same problem here ;/ only the first 2 tests get executed
Does that help?
Could you explain the algorithm you are using?
I'm getting the same error. Non-adjacent piece should NOT flip - Expected: ".O.O*.", instead got: ".O.****."
Is this correct? I don't understand why the answer is not ".O.****" instead of ".O.O*"
The instructions say that move should flip anytime it is sandwiched by another move.
Thanks
Consider what happens to your code if you get an empty list.
*
is a special markdown character that causes italics or bold so you to surround it with backticks.'.O.****.'
should equal'.O.*O**.'
What does the board look like before you place the piece at index 6?
Could you explain why it makes sense to flip the
O
at index 4?Due to some changes on the servers, the javascript version is having problems now. Seven people passed before without problems. I checked the python and ruby version and are working fine.
Let's see if I can make some changes to speed it up.
Me too have the same problm.Can anybody optimize it
@MariusAFT
,The return value is supposed to be a string ->
"None"