5 kyu
Convergents of e
34 of 99HDdo
Loading description...
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.
Haskell translation
approved
I am unsure my solution can be faster asymptotically. Does this kata require micro-optimisation?
I wouldn't really call it a micro-optimization, but you should look into your use of
Rational
here. Every binary arithmetic operation onRational
s requires a call togcd
to ensure that the resultingRational
stays in its simplest form.I'd call that micro-optimisation. But I'll look into it.
( I forgot to check back, because I'm not getting notifications for this thread. )
I looked into it. Now solving the JS version, and performance requirements are pretty ridiculous. Not your fault then.
Python is currently failing with what appears to be an error in the reference solution (see spoiler comment below).
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I assume this can't be solved in Python in time just now right? I find if I just print the convergent number and return 0, that takes over 5 seconds, which is nearly half the time.
Here's the a short bit of the output of doing that...
I also find that my solution runs in about 6.5 secs on my PC but times out on CodeWars
Missing pictures in the description. It looks like it should be
trickiest 5 kyu yet, mad props!
suggestion: I would maybe add a picture like this to the description, it's what I kept looking at to do this.
Python translation
Please approve.
could you have something like "Your Mission" to get more clearer?
did not get implemented
Good kata, thanks!
This comment has been hidden.
hint: think big
Hi,
I understand nothing to the description... :/
e = [2; 1,2,1, 1,4,1, 1,6,1 , … , 1,2k,1, …].
=> I finally got that it correspond to the notation used at the top, but it actually doesn't match this notation correctly (where are the parentheses!?). And what is thek
thing? You should explain that as well (even if I have my idea about that)What is most surprising is that the important mathematical constant, e = [2; 1,2,1, 1,4,1, 1,6,1 , … , 1,2k,1, …].
=> that doesn't mean anything: where is the end of the sentence? what is surprising about that constant??sum of digits in the numerator of the 10th convergent is 1+4+5+7=17.
sqrt(anything)
is irrelevant to the task at hand. It's just for demonstrating the operation we're going to do in the kataYou really need some coffee ;-)
Not now, I'd like to sleep, this night... ;p
For the other points, that doesn't change the fact that the description needs several updates (and, no, it's not to me to seek for the link ;p ).
Now, question:
description is clear about task
Approved
This comment has been hidden.
This comment has been hidden.
Needs Random Tests
Added