Retired
Convert recurring decimal to fraction (retired)
Loading description...
Mathematics
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Not only does this kata not do a thorough job of testing, I suspect the solution tested against to be wrong. I just ran all of the other verified solutions against this:
and none of them give the right result for the second line. To be fair, one works correctly when passing in
0.9090
and another with0.909090
, but partial credit isn't quite the same thing as correct, is it?Although my inital solution accidentally passes on this test, there are similar cases where it failed.
I know how to patch my code, if only there were a way to edit a submission without resubmitting a new one. That' just brilliant.I've resubmitted my patched code and forked too. Not sure the difference.I haven't been on codewars long, but I feel like any kata that requires importing modules shouldn't be 8 or 7 kyu. Or there should be a mention of the module to import in the description.
Do you still feel this way?
How would someone use a while loop in python for a kata like this?
Lack of cases like
Ha that, second test has exposed a flaw in my solution. We get different answers for that case, when I run them side by side, so I'm going to assume yours is the better solution.
OK my solution works for 0.8088 and 65.666, but only if the recurring part is shown as '88' and '66' respectively. This I did know when testing against similar test cases and I made allowances for it by doubling up the recurring digit.
Your solution doesn't require it.
This comment has been hidden.
Needs Random Tests.
Thanks for feedback, as you'll have noticed this is my first attempt at creating a kata, curious as to how I can go about generating random tests, or do I literally generate a list of random recurring decimals, and run them through my algo to get correct results?
Well, the common setup could be
Updated test cases