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.
Bash translation
Lua translation!
Rust user here. I have a rust solution that works on the basic test cases but gives this error on the complex ones "attempt to multiply with overflow". I have tried using both u64 and i64 types in case some tests were very demanding but i got the same error. Any ideas?
Nim and R has no random tests, and R sample tests do not have
test_that
.TypeScript tests are not considered random: the order of the answer is almost always fixed (as random tests almost always expects
false
). See thisC++ random tests generates false test cases in a laughably weak way it's too easy to deduce the pattern and pass them. See this
In general, the random tests in all languages need to stop cheating the negative input generation by only choosing a small subset of the full input range. Honestly it's pathetic.
Different language versions have wildly different input ranges, which should be normalized. On top of that, some language version have unacceptable input ranges:
n = 50000
n = 1634
n = 8208
n = 4887
(and only positive cases up to371
)u64
, which is too big for this task, since it can cause calculation overflow in certain input range (e.g17999999999999999999
)115132219018763992565095597973971522401
, which is unnecessaryThis comment is hidden because it contains spoiler information about the solution
I passed all tests, but cannot attempt. Why?
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?
I'm stuck on this with Swift. My code passes all tests except for very large numbers apparently:
Full Tests
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 35875699062250035
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 4498128791164624869
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 4929273885928088826
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 21897142587612075
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 1517841543307505039
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 35641594208964132
XCTAssertEqual failed: ("true") is not equal to ("false") - Should return true for 3289582984443187032
When I logged my output I saw that I have rounding errors, for example:
9 ^ 19 = 1350851717672992089
But Swift returns 1350851717672992000
Has anyone had the same problem? Any tips?
Actual and expected are swapped in PHP, also assertion messages are not filled in completely for all test cases
Hi Julian,
Would you please be so kind to let me know what you think about the proposal of hardening tests in all languages of this kata so only O(1) solutions pass?
Thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Go translation
This comment is hidden because it contains spoiler information about the solution
Loading more items...