Ad
  • Custom User Avatar

    It was a problem with my solution. Fixed now. Thanks for the feedback.

  • Custom User Avatar

    You are absolutely right: fixed!

    Also, now one should NEVER get an error even with egde random test cases in Python; working to do the same on Ruby.

  • Custom User Avatar

    Hey @code4food try it now, GiacomoSorbi has resolved them...:-)

  • Custom User Avatar

    Hey @GiacomoSorbi need your help over here.

  • Custom User Avatar

    The example is an example, it must be read:
    "if percent of loss first month is 1, ...."
    I modify this part and hopefully it will be clearer for you.

  • Custom User Avatar

    hitting the same issue

  • Custom User Avatar

    This is due to an error in the reference solution. I'll try to get it fixed, but I don't have write access on the tests anymore.

  • Custom User Avatar
  • Custom User Avatar

    I'm getting a similar error:

    Falsifiable (after 2 tests): 
    expected: Just 0
     but got: Nothing
    [()]
    Positive {getPositive = 1}
    -1
    

    It has to be broken because a negative page or item (depending which function is being called - I can't actually tell) has to be invalid, and therefore a Nothing.

  • Custom User Avatar

    Well, if you want, I can test your solution on my local machine, then I might find out whether I made a mistake. I already fixed the test to also use the method you described ( :) ), but I don't think it changed much, the test cases run my code in a few ms.

    It could also be your fibonacci solution, without sharing it can get very big.

  • Custom User Avatar

    Yes you are correct, I test it via brute force, which is not optimal. Surprisingly it passed with my solution, so I guess it is partially a problem of your definition. I updated the description, so you may want to take a look at the final hint!

    Thanks for the feedback.

    edit: I replaced it now, but I used the Small modifier from QuickCheck, which generates small numbers, e.g.: sample (Small <$> (arbitrary :: Gen Int)) results in values less than 20.

  • Custom User Avatar

    The reference implementation returns -2 for those inputs. This contradicts the kata description, which claims

    Input will always be a non-negative integer

    and

    If input data is invalid you should return 0