Ad
  • Custom User Avatar

    Try selecting version 8.2, if available.

  • Custom User Avatar

    I tested this under a very small data range because my own solution is quite slow.

    T_T

  • Custom User Avatar

    There doesn't seem to be performance tests in this Kata so chances are your "proof" is relying on a circular argument, e.g. a * b = b * a because b * a = a * b because a * b = b * a because ...

    If you've checked your proof extensively and found no such arguments, then my best advice is to see where you could perhaps shorten your proof by using fewer steps (easier said than done, I know). Hope this helps :)

  • Custom User Avatar

    After looking at it a bit deeper it's the same thing over again:

    if v is ommited, fill the array with undefined

    The error is actually

    `prefill': wrong number of arguments (given 1, expected 2) (ArgumentError)
    	from `<main>'`
    

    Yes, I know it's not the perfect place to put such a test, and Ruby's testing framework still has that bug, but clearly you haven't read the descriptions or read the previous issues where I've answered the exact same thing. So...

  • Custom User Avatar

    •if n is anything other than an integer or integer-formatted string (e.g. '123') that is >=0, throw a TypeError

    There are strings as inputs. Make sure you handle them properly.

    (Also, the test does work when it's 0, so you're probably failing at other test cases.)

  • Custom User Avatar

    Done

  • Custom User Avatar

    You can speed it up by writing a shorter proof. Give it a shot!

  • Custom User Avatar

    The tests uses Template Haskell to generate tests to verify the proof. So it'll naturally result in longer compile time.