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.
Needs tests. After I solved it correctly, I went back and was literally able to change the return type to
String
and still pass.Solved it in Swift, passed all tests, but my solution doesn't show up in the list...
Clicked on "My Solutions", and it shows up under this:
Wuh? (I did it twice in a row just to make sure the test cases were not actually being updated at the same time I was submitting)
You're right, I should have specified. I was also snarkier than I should have been, so apologies for that.
While I am using Swift, I generalized my comment after reading some of the others with the same complaint.
A better suggestion would be to edit the description so that it only shows the portion asserting how the input will be formatted to languages where this is true.
Reporting again since it's been 8 months since the last one...
Nope. Tests are full of 3 (or less) digit strings. Either the description should be changed, or the tests fixed.
You have options. Pick one.
Bringing this up again to make a point...
No one attempting this kata in Swift 4 can pass the tests, because the tests themselves throw errors.
In Swift 4,
toIntMax()
has been completely removed. Unfortunately, it is used extensively in the tests.This can be fixed by casting variables to
UInt()
instead.So...
let length = (range.upperBound - range.lowerBound + 1).toIntMax()
becomes...
let length = UInt(range.upperBound - range.lowerBound + 1)
I had a solution in ~2 minutes, and now I’m left frustrated. Hopefully this can be fixed soon...
Swift translation added: https://www.codewars.com/kumite/5bdd099d9891bec14e000051?sel=5bdd099d9891bec14e000051
Swift translation added: https://www.codewars.com/kumite/5bdce53a78d24e664d00007a?sel=5bdce53a78d24e664d00007a
For Swift, the parameters in the function stub are of type
Int
, but the test cases supply typeInt64
. Not a huge deal to correct on the user end, but a little confusing at first. Changing the function stub parameter types toInt64
should remove the confusion.