6 kyu
Math challenge #3 [Medium]
69 of 81goldenratio161
Loading description...
Mathematics
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.
Thanks for correcting the test cases. I was wondering what on earth happened with my calculations!
I had to view the solutions to understand part of this so I need to work on my calculus
I've taken the liberty to fix the open issues and suggestions. A JS translation was added in the process. Enjoy :)
on behalf of everyone, thank you!
The description should use katex to increase readability:
=>
Let f(n)=∫0n⌊x⌋x⌈x⌉dx
done
oh no, my solution is wrong :P
changing it now
EDIT: changed, is it better now?
Example tests are still wrong.
The last two sample tests need to be changed :
n_vals = [[1, 0], [2, 3], [3, 18], [4, 60], [5, 150], [342, **420115062**], [56753, **386209565**]]
done
Is the reference solution correct? My solutions passed 25 tests including some big ones, so I'm not sure what could be wrong... (I can't see the spoilers.)
I'm in the same boat. I'm pretty sure I have the right formula but only pass around 30 large tests.
same. Even following along with the "video" the author describes, my solution passes around 30 per run.
I believe the reference solution is currently broken. It does not apply the modulus correctly, so it often produces wrong answers for large inputs.
The reference solution is broken. ( The large fixed tests are as well. ) This has been raised as the spoiler issue.
This comment has been hidden.
yup, I definitely made a mistake
but what is
∫₀ⁿ
?∫0n
Oh, it's the integral from
0
ton
! I honestly absolutely didn't read that in it.mauro-1, just curious, how do you type that using "math" font?
Please see Docs, on
Math
MarkDown. Duh Innernet at large has even more documentation on that. It might be called Katex.Link: https://docs.codewars.com/references/markdown/extensions#math-typesetting
f(n) = ∫₀ⁿ ⌊x⌋x⌈x⌉ dx
f(n)=∫0n⌊x⌋x⌈x⌉dx
This comment has been hidden.
no you're good reference solution was just wrong :P
This comment has been hidden.