Ad
  • Custom User Avatar

    You still can post your code if you need help and get stuck after looking for a solution by yourself, and you'll see if someone answers you. Don't forget to add a spoiler flag if you do that.

  • Custom User Avatar

    i'm using python.if you are a python programmer, i will share the code, hopefully you can find the problem.

  • Custom User Avatar

    No, instructions are not wrong, and tests are not wrong.

    You are experiencing problems caused by the fact that your solution uses an approach which loses some precision at some step. You need to find a way to keep your calculations exact so intermediate or final numbers do not get incorrectly rounded or truncated. There's hint in the description to stay in domain of integers all the time.

    Avoid real division, avoid floating point inaccuracies, and avoid unnecessary rounding, and things will be OK.

  • Custom User Avatar

    Please say which language you're using. I have solved this kata in several of them and had no problem with that, seconds must be rounded down.

  • Default User Avatar

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

  • Custom User Avatar

    Nothing stupid here. If you time out it means your code does not handle properly some cases (think about corner cases maybe?). In an IDE you can only try out the basic tests but the full test battery is more exhaustive and the challenge of a kata is to handle correctly all possibilities.

  • Custom User Avatar

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

  • Default User Avatar

    Not an issue.

  • Default User Avatar

    Pretty sure I'm having floating point errors and I'm unsure how to correct my solution for them. Off by one on a couple tests each time.

  • Custom User Avatar

    It's true! I just realized now. Thanks.

  • Default User Avatar

    This test appears only once. You badly interpret the output.

    There is no error in tests:

    For number: 170232833617690725 Got: 76, 7 (You returned 76, 7 - which is wrong)
    For number: 170232833617690725 Expected: 0, 16 (It was expected 0, 16)
    Error. Expected 0, 16 but got 76, 7 (Hence error with explanation)

    Before posting issues look at the top of the page: 483 people passed the C kata... If there were errors somebody would have already seen them. Sorry. Cheers.

  • Custom User Avatar

    C lang. There is a badly planned test:


    For number: 0 Expected: 0, 0
    For number: 170232833617690725 Got: 76, 7
    For number: 170232833617690725 Expected: 0, 16
    Error. Expected 0, 16 but got 76, 7

    The last two tests are the same but expect different solutions.

  • Default User Avatar

    Before posting issues look at the top of the page: 1948 people passed the Python kata. When this number is high, high are chances that your code is wrong. Sorry. Cheers.

  • Default User Avatar

    On the final basic test I'm getting:
    ValueError: invalid literal for int() with base 10: ''
    m shouldn't be a non positive int let alone an empty string.
    The other 208 tests pass and I'm unsure what is wrong.