Beta
Digits of e
5 of 7Dr Gabo
Loading description...
Mathematics
Performance
Algorithms
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.
https://www.codewars.com/kata/reviews/5e9a335aa66a4c00019dc931/groups/5e9c6a7536c5250001495cb4
The description has been out of sync from the tests; the example still writes
e_digit
.Are you sure this cannot be solved by copy-pasting solutions from "multiply/divide integers as strings" and translating Unnamed's solution into C++?
I'm not sure if naive algorithms will be enough here (I'm guessing not). But even if they were, there is a 700 bytes limit. Do you think it can be translated in that size? :/
Also, you would need LOTS of iterations for that algorithm to work with these sizes.
No need to tranlsate https://www.codewars.com/kata/reviews/5e9a335aa66a4c00019dc931/groups/5e9aca643324d3000152aeae
I'm legitimately unsure about whether or not I should consider that a valid solution. Indeed, it's clever, but it's not what I had in mind at all.
Changing the test ranges to [0, 20000] should (in theory, I dont know anymore :p) make your python solutions timeout (with this approach at least), while mine would still be working. I'll try doing that.
(I'm learning so much with these :D)
Edit: done!
OK, solution updated.
I don't think there is a point in updating my solution anymore, but the anti-cheat tests. Is it even possible to forbid someone from using a system command? Messing with the python executable seems like a horrendous idea.
EDIT: I made some anti-cheats and reduced the test range to avoid unnecessary server load. If you manage to modify your solution (which you probably will), then I will take it as valid. It's no use giving so much effort to a kata nobody has even completed as intended.
Okay, I decided that a C++ implementation would be the best option. This is my first C++ kata, so it might be a little bit rough on the edges :)
Hope it's a little bit more challenging now.
I'm unpublishing this for a future rework because I understimated classical approximations and overestimated mine. I think its for the best :(
Looked good to me. No similarity between this Kata and the supposed similar Kata claimed in the thread below. You should publish.
I appreciate it, but @Unnamed submitted a solution that made clear that mine was not performant enough (at least for my liking). I will publish it again after I make a better solution that invalidates that approach.
So, what's the input range?
[0, 2000], but the tests give a little bit more info. I just updated the description.
https://www.codewars.com/kata/reviews/5e99a9f3dcf07b0001582a7d/groups/5e99de62b9b139000191d917 - I thank ZED for this amazing idea.
It is indeed an interesting workaround! I set a byte limit this time to prevent that from working.
Is it intended that all math-/numbers-related libraries are forbidden now? This should be mentioned then.
I doubt everybody will randomly know whether some library depends on
math
or not.The thing is, I'm not really sure how to list every library that depends on them or even if I should. In any case, it is intended.
Maybe the safest way to know if your library is allowed is printing it. if it gives
None
, then it's not. It's not ideal, but it's the best I can come up with :/ (I just modified the description)At the very least, you should mention that
decimal
is not available because it forbids one possible solution.If you don't know what else is not available, you could say something like "math-related libraries are not available too" because "forbidden libraries return
None
on import" is just as useless message.thing is... my module forbidder is supposed to raise an exception if a module relying on one forbidden is imported. So... just wondering why this has been changed. Because this is the best possible feedback in this kind of situation... :/
(unless there have been changes I didn't notice with the last update...?)
@Blind4Basics I used the version of the forbidder that you used here: https://www.codewars.com/kata/56b0f6243196b9d42d000034/python with the modules that I specify in the description :/ (I might be using it wrong, but I didn't change almost anything)
Edit: It seems like it's broken there too! is there any updated version?
XD
Actually I did the opposite of what I thought I did...
replace this with:
or something like that. I'll try to update the different places in the next few days (...where I know it's used... I guess it already spread in other places...)
Thank you very much! It's fixed now :)
I made the tests much harder because @ZED.CWT managed to cheat >:(
Also, updated the rank because this seems harder to solve than I initially thought.
fractions
is disabled while it's not told anywhere... (Is that even intended?)damn it
either I lost my eyes again or we are cross messaging. seems good, thx
Probably because it depends on
math
(just guessing). I preimported it like you said.Edit: I'm fast :D
same with Decimal...
what did you use exactly? Because the import itself is just returning None. The least would be to raise at that moment, so that the user is warned that the import is fautive.
(the worst part for you is that I'm pretty sure those won't be of any use........)
I used your anticheat with the modules listed in the description. Also, I can import
decimal
just fine :/In any case, I might just erase the preimports if you dont manage to solve it with them, since I don't think it can be done and it might be seen as misleading.
wt... X/
forget it, I tried to import Decimal... x/
In any case, I just removed
fractions
because I really don't think that preloading modules is needed. I hope I didn't screw up your solution (if so, please tell me).https://www.codewars.com/kumite/new?group_id=5e99b183dcf07b0001582ed0&review_id=5e99a9f3dcf07b0001582a7d
This comment has been hidden.
Done! Please, tell me if you find another way to cheat :)
I was surprised that I didn't find anything in CW that asked for this! Please, let me know if this should be a translation of another kata that I'm not aware of.
Happy coding :)
related, maybe? https://www.codewars.com/kata/5a8d63930025e92f4c000086 (note: note implying anything here: I didn't do that one)
I'm pretty sure that solution would not work here. Something much more efficient must be used in this kata.
Thank you for looking it up anyways :)
Related, but very different. One method of calculating the euler constant is completely different from another. This is a good, moderately difficult, Kata.