Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
i'm using python.if you are a python programmer, i will share the code, hopefully you can find the problem.
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.
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.
This comment is hidden because it contains spoiler information about the solution
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.
This comment is hidden because it contains spoiler information about the solution
Not an issue.
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.
It's true! I just realized now. Thanks.
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.
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.
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.
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.