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.
You've already been told that code working in another version of Swift and not in the one available is not a kata issue. Please don't open more issues about that. Your code has a problem too, it won't work when called several times in a row.
Please see this post.
I tried your code in some REPLs and indeed it seems to compile fine on Swift 5.8, but not on Swift 5.3. However, it is not an issue with the kata itself, but rather with general setup of Swift on Codewars. I created this ticket as a follow-up: https://github.com/codewars/runner/issues/261, and I am going to close this discussion as not a kata issue.
What version of Swift do you use in your XCode? Is it possible to configure your local XCode to use Swift 5.3? Does your solution work locally for you in Swift 5.3?
No answer after 5 months, closing.
What version of Swift are you using locally? Note that this kata uses Swift 5.3. The error seems to be correct, because you have the range
"4"..."20"
in your code, which is not valid, because "4" is greater than "20" so "4" cannot be a lower bound while "20" is an upper bound.Your code is wrong:
Not a kata issue.