Ad
  • Default User Avatar

    The string can be converted to a set directly

  • Default 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

  • Default 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.

  • Default User Avatar

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

  • Default 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
    
  • Default 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

  • Default User Avatar

    Expected results are inconsistent between Haskell and Ruby, Crystal. The same input expects different results. For example an input of 696 expects 38 in Haskell but 23 in Ruby.

  • Custom User Avatar

    1.0 has been enabled so I am goingto reject the forks

  • Custom User Avatar

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

  • Default User Avatar

    Solution works fine in Ruby and Crystal but times out in Haskell?

  • Custom User Avatar
  • Loading more items...