Ad
  • Custom User Avatar

    It is a generator btw.

  • 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

    Also, examples show "17 17". It is not clear what this is intended to convey.

  • Custom User Avatar

    The input is 0 [-1]. Actual and expected are not shown; this could be achieved by replacing == by ===. Random tests do not actually guarantee "All numbers in will be positive integers", just that they are non-zero, but generated zeroes will be shown as input.

  • Custom User Avatar

    The string can be converted to a set directly

  • Custom User Avatar

    Yep, the contents of wiki are very different and tests are not passing. Too bad, because this kata is very real-life unlike most of them here.

  • Custom User Avatar

    I'm confused as to why it knows c represents characters in the strings

  • Custom User Avatar

    Fixed. All solutions invalidated I guess. :P

  • Custom User Avatar

    A logic that works for Ruby isn't working for Haskell. There should be consistency across languages. Only 1 default test isn't helping either. We're left with having to attempt trial and error method to fix issues.

    I don't know why I am encountering negative indices in Haskell. Shouldn't '>' be explicit. Even if I assume it when it's actually absent, I am not getting the results the tests expect.

  • Custom User Avatar

    i added a return value to the initial code so that it does not throw

  • Custom User Avatar
  • Custom User Avatar

    Crystal random tests seem incorrect:

    n = 65_u64, p = 10_u64

    Expected: 149823132181_u64
         got: 1074082795968_u64
    

    I ran these inputs on python and javascript solutions (including your own, author) and they're indicating my answer is correct.

  • Custom User Avatar

    I just ran this and I'm not getting any errors:

    def diagonal(n : UInt64, p : UInt64) : UInt64
      42_u64
    end
    
  • Custom User Avatar

    Issue with the Crystal variant. Getting the below error. Tried removing all my code and still getting it. Seems like something wrong with the tests.

    Error in line 1: while requiring "././spec.cr"

    in spec.cr:3: while requiring "./fixture"

    require "./fixture"
    ^

    in fixture.cr:27: instantiating 'dotest(UInt64, UInt64, UInt64)'

    dotest(20_u64, 3_u64, 5985_u64)
    ^~~~~~
    

    in fixture.cr:3: instantiating 'diagonal(UInt64, UInt64)'

    actual = diagonal(n, p)
             ^~~~~~~~
    

    in solution.cr:1: type must be UInt64, not Nil

    def diagonal(n : UInt64, p : UInt64) : UInt64

  • Loading more items...