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.
Closing because it was never answered and there will always be ways to cheat.
It's hard to detect if it's written inside a comment. What do you propose? IMO it's not a kata issue.
This comment is hidden because it contains spoiler information about the solution
According to PEP 8 - Other Recommendations:
Hi,
You should read the documentation about authoring, if you're interested in that. You might see why your kata isn't "welcomed" so far (no context, the task is totally articifial)
(Other than that, the expected value has to be computed first, otherwise the random tests are "vulnerable". => that's the issue part. See this documentation too)
Cheers
Description is hard to grasp ... solved by testing and tweaking but I have no clear idea of what the task really is.
If deobfuscation of description is not part of the kata, description could be improved.
Fixed description
Sorry for my bad english, i am from Belarus
The description is still incomprehensible and wrong. Not only "remove last digit if sum after step 'if sum is odd, add normal number to the end' is odd" is a terrible explanation but the author's solution doesn't follow the instructions again. The correct behavior is "if the number of digits is even before possibly appending a
0
at the end, remove the last digit".Fixed description and solution
Fixed description and solution
Looking at the kata author's reference solution, the description does not match the actual logic at all:
if length of sum is odd
should beif length of number after "if sum is odd, add normal number to the end" is odd
remove middle number (21120 -> 2120)
should beremove number at/after the middle
, e.g12345 -> 1245
and1234
->124
if added 0
is actuallyremove last digit if sum after step "if sum is odd, add normal number to the end" is odd
Yeah I'm confused about this as well.
What on earth does "if added 0" mean? And why do we remove zero in
12 -> 2112 -> 21120 -> 2120 -> 212
but not in13 -> 31 -> 310 -> 30
?For
4345
we do not add0
at the end becauselen(str(4 + 3 + 4 + 5))
is not an odd number, but the expected result is5440
, wtf is this???