Beta
Guess the (prime) number, digit by digit
29 of 32macambira
Loading description...
Mathematics
Performance
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.
Hi,
opening as issue to avoid approval before a decision is made:
I have (and some other users as well / Note: not the published version of mine, it's the one in the fork) a solution that works consistently with 5 guesses at most. I'd suggest to reduce the limit to that number, if that can forbid the somewhat "cheezy" approaches, like the second python solution. Thing is, I'm not sure this will totally forbid the approach, but that might make it tedious enough so that users will go to the expected solution.
If so, that would make a good 4 kyu, once some additional tests/constraints are added (see discussions below)
In any case, the tests must be rewritten (in python at least):
it
blockCheers
I would like to mention that I have a solution that works in at most 3 uses of the helper function for all 8363 primes.
It's been a while without any progress on the kata, perhaps we should aim at 5 kyu then.
Keep the number of tests (similar), but make sure to test some of the numbers multiple times, to avoid solutions like mine...
Maybe add a few more numbers to the sample tests, from the top and bottom of the possible range.
Ruby sample tests has incorrect method name
Changed the name from the initial solution.
solved
c#: on submit error:
Fixed!
Yep, please put your kata back to Beta now :) It got sent back to Draft because of the number of open issues.
This kata can be cheesed a little bit: https://www.codewars.com/kata/reviews/6320eb8dd54c570001d3f988/groups/6321b5d22e5c0200011f5472
I suggest to shuffle the primes to guard against cheese attacks.
fixed
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I've wrapped
wrapper
inside another wrapper, but with a function. I'm not very familiar with messing with Python's Data Model like that, so I'm not sure in how to implement the class the way you say, but I hope this could make this somewhat more difficult than previously.I'll mark as resolved to get you out of Draft. In case more tweeking is required, I suggest to open a new "suggestion".
How many test cases are there? I can only pass about 3300 random tests before timing out.
It tests against every 5-digit prime number, so 8363.
Holy moly! I think I'll reconsider my approach...
Is it necessary to test them all? If so, you should consider adding a
performance
tag.I'm not sure? Like, the Python Solution takes ~1 second and the Ruby one ~3, so It's not like you have to worry too much about optimization, but if more people think it makes sense the tag could be added at some point.
I would still add the "performance" tag. You only needn't to worry about timeout when using an appropriate algorithm :)
Boy, did I struggle to make it pass! And I'm not proud of my solution...