Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I'd suggest to add 120 and 2016 to test suite, see code for my solution for more info.

  • Custom User Avatar

    I can imagine certain edge cases with calculation of compounding depending on how the person withdraws money.

    E.g. with example from the problem.

    f0 = 100000, p = 1 percent, c0 = 2000, n = 15, i = 1 percent

    If person withdraws money on Dec 31 of year 1, then f1 = 100000 * 1.01 - 2000 = 99000, but if person withdraws money on Jan 01 of year 1, then f1 = (100000 - 2000) * 1.01 = 98980

    I guess you can either rephrase the problem with "withdraws at the end of the year" that'd apparently match the test cases or make the whole kata slightly more complicated :)

  • Custom User Avatar

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

  • Custom User Avatar

    Test case is not compilable:

    /tmp/haskell116115-17-1qudwmy/Codewars/Kata/FirstCharacter/Test.hs:11:32:
    No instance for (Show a0) arising from a use of shouldBe' The type variable a0' is ambiguous
    In a stmt of a 'do' block: firstDup [] shouldBe Nothing

  • Custom User Avatar

    Tests are (apparently) still broken:

    /tmp/haskell11618-18-143uzzq/FindingAnAppointment/Test.hs:43:28:
    Ambiguous occurrence shuffle' It could refer to either FindingAnAppointment.Test.shuffle',
    defined at /tmp/haskell11618-18-143uzzq/FindingAnAppointment/Test.hs:72:1
    or Test.QuickCheck.shuffle', imported from Test.QuickCheck' at /tmp/haskell11618-18-143uzzq/FindingAnAppointment/Test.hs:4:1-22
    (and originally defined in `Test.QuickCheck.Gen')

  • Custom User Avatar

    For goodness sake, how is this trivial thingie a "6 kyu" problem?

  • Custom User Avatar

    Have you tried to run it with arguments being length=1 and width=100000000?

  • Custom User Avatar

    Garbage collector would hate you for such kind of coding.