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.
The string parsing code is much larger than all other examples and it even contains a goto...
JudgeWin is a confusing name for a method that also changes the positions.
I don't get how you managed to change b.
This comment is hidden because it contains spoiler information about the solution
This code is just a little bit to clever for my case. I do really like that the actual loop is very easy to read.
The [] lead to list comprehension which will actually create the array. Omitting [] is the same as replacing it by (). That is a generator expression, which does not construct the array first and should therefore be preferred.
This comment is hidden because it contains spoiler information about the solution
I would like to approve of the translation. But the site is not processing my approve.
Looks very good. I especially like the free_fsm. Looking at the tests I do not get the purpose of the get_with_offset function. And it also seems you are not using input_str in the random examples.
The C version reference used in the tests is incorrect which can lead to segfault. The provided C solution is just as incorrect as the used reference. It is a pity because the idea of the kata is quite nice. I got my compile to replace the solution compile, so I am pretty confident about the result.
The provided C solution does not pass the unittest, although the unittest follows the code example. The provided solution seems to perform one extra state transition.
I think this code would not hold if you have two words of ten characters.
C++
This comment is hidden because it contains spoiler information about the solution
Why do you add 0.9? Isn't it safer to use ceil?