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.
make sure your types can fit your values
your rounding error probably comes from involving f64, python:
likewise, make sure you use a large enough integer type - for example, 1350851717672992000 barely fits in a 64-bit int but not in a 32-bit int, and if you were to go a bit bigger than that you would overflow the 64-bit int as well
Have you resolved it? I have the same problem
Strange with Swift.
Tests with very large numbers do not pass. In Xcode, for example, the number 35875699062250035 outputs as false. Moreover, if I do print, then the last received number, which is raised to a power, differs by 2 digits - 35875699062250037
Does anyone know what the problem is?
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.
This comment is hidden because it contains spoiler information about the solution
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.
Thanks for reply!
My Xcode version: Apple Swift version 5.8.1
I think it must work on higner version of Swift
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?
This comment is hidden because it contains spoiler information about the solution
No answer after 5 months, closing.
This comment is hidden because it contains spoiler information about the solution
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.Solution is working in Xcode, but it doesn't working here. Issue with tests
Fatal error: Can't form Range with upperBound < lowerBound: file Swift/ClosedRange.swift, line 335
Your code is wrong:
Not a kata issue.
Loading more items...