Ad
  • Default User Avatar

    i solved it with big int and it passes an refrence error at the last 2 tests
    how do you solve it?

  • Custom User Avatar

    Hey, thanks for the feedback.

    While you are correct consider that there was no expected behaviour specified, e.g. should we return null oder string.Empty, which is the reason for me letting the method raise an exception in the case of the parameter being null.

  • Custom User Avatar

    This solution will fail if the argument (cc) == null => Calling Length property will throw a "System.NullReferenceException: 'Object reference not set to an instance of an object.'"

  • Custom User Avatar

    That is a good question: the parsing changed a few months ago (and I didn't update my tests, as that would possibly invalidate all the previous valid solutions or anyway have them re-run with a waste of CPU time for CW), so I am not sure I can tell.

  • Custom User Avatar

    This was a really fun kata. I'm a bit concerned that Codewars doesn't sanitize the HTML formatting in their strings though. Like... It makes things extra easy to read, but isn't that a liability!? Or are only certain formatting tokens allowed?

  • Custom User Avatar

    Using BigInteger decreases the difficulty of this kata greatly. Unless this is addressed, I think this kata is far too easy for its difficulty. :/

  • Default User Avatar

    100% agreed, this is a 7k problem.

  • Custom User Avatar

    The tricky test cases like the "Bananas in Bahamas" did lead me to pleasant additional discoveries though, so I did find that aspect really enjoyable!

  • Custom User Avatar

    My thought with the kata was for the solver to go on a journey, discovering the different requirements along the way. (That's why the description added the "figure out the rest from the given test cases" part.)

    From your comment (and a lot of the ones below) it seems like that was a bad decision. I'm not sure if the intention is unclear or if people just don't like that sort of katas.

    In the future, I'll try to be even more explicit about not stating all requirements up-front or just be more precise in what I expect.

    Being more precise would probably make it easier for the people translating katas.

    I'll give some thought about what to do with this one.

    Anyway, many thanks for your suggestion and taking interest in my kata. I'm happy you enjoyed it. :-)

  • Custom User Avatar

    I thought this kata was pretty neat!

    One of the test cases required the handling of extra characters, with its test case expecting that there cannot be any extra characters in the remaining string parts. However, this isn't specified clearly in the problem text.

    I recommend to add this as another restriction, something like, "are in the same order as in s" AND "do not contain extra characters after s". Or something like that.

  • Custom User Avatar

    If you link your Github to your Codewars profile, your Github avatar will sync over to Codewars. :)

  • Default User Avatar

    I believe the expected field was swithed with the "but was" field in the output section.

    "String lengths are both 8. Strings differ at index 0.
    Expected: "03:59:59"
    But was: "99:59:59"
    -----------^"

  • Custom User Avatar

    howMany has the possibility of being a decimal number due to your math. Be sure to properly convert it to an integral value!

  • Custom User Avatar

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

  • Custom User Avatar

    It sounds like your GetReadableTime method is not returning anything.

    Try including that test case in your example cases and trace your code to see if your code can't properly handle that input. Your input for that case should be 23050 seconds.

  • Loading more items...