Ad
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    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?

  • Custom User Avatar

    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 this

    C++ 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.

  • Custom User Avatar

    Different language versions have wildly different input ranges, which should be normalized. On top of that, some language version have unacceptable input ranges:

    • Haskell only goes up to n = 50000
    • Nim goes up to n = 1634
    • PHP goes up to n = 8208
    • R goes up to n = 4887 (and only positive cases up to 371)
    • Rust and Swift uses u64, which is too big for this task, since it can cause calculation overflow in certain input range (e.g 17999999999999999999)
    • Python tests number as big as 115132219018763992565095597973971522401, which is unnecessary
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I passed all tests, but cannot attempt. Why?

  • Custom User Avatar

    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?

  • Custom User Avatar

    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?

  • Custom User Avatar

    Actual and expected are swapped in PHP, also assertion messages are not filled in completely for all test cases

  • Custom User Avatar

    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!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...