Beta
Master Puppeteer
Loading description...
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.
Another incorrect solution that needs to be addressed: https://www.codewars.com/kata/reviews/61f3163624fe410017d0378f/groups/654a520847febc0001406501
For me, to understand the logic of this kata is
4 kyu
, but coding is6 kyu
.It is dufficult to choose...
I understand. But I have also heard the opposite.
My opinion would be that if the act of formulating a solution from the problem is considered X-kyu, then the kata should be rated X-kyu.
But I guess, it is not for me to decide.
This comment has been hidden.
Thanks for hinting that!
Letting you know, that I am currently working on a fix.
However, it turns out that it is not that trivial to do. If you have any suggestions, I am eager to hear what you propose.
A simple idea is the following:
Several (or zero) random persons (
k
) may be assignednp.ones(n)
.Of course, way easier than what I was building. Thank you!
I am satisfied to inform you, that your solution now fails successfully ;)
Closing this.
what are you doing in that test, exactly?
because the current setup suggests that there are huge tests in there, but I cannot even print the length of the inputs, so it seems my function isn't even called, there.
=> ???
edit: you need to say in the description that you provides a numpy array, not a regular python object. Btw, is taht a np.matrix or nested np.arrays?
This comment has been hidden.
This comment has been hidden.
ah right, I forgot the ouput isn't shared when using the timeout utility... :/ (note: I was printing the length only, not the full input)
in any case, 1ms is way too short. you cannot guarantee there won't be an overhead somewhere that will make the test fail.
What is the size of those matrices? (about that, see my edit above)
no, it doesn't show up in the huge tests.
Something that is new to me also, good to know!
Ok, I agree. Since you are more experience, what would you suggest out of the following choices: 10ms, 50ms, 100ms ?
Size of the matrices is
n^3
many integers. The type of the input isnp.ndarray
as the inputs are easier to generate using numpy and I can add this to the kata description.I see that there will be a discrepancy since the fixed example test cases are fed nested Python lists.
However, finalizing the generation process with numpy's
.tolist()
causes even more time overhead which would require to reduce test case numbers if the input should always be a Python list.Any thoughts?
This comment has been hidden.
note: if you put a spoiler flag on your answer, I don't get notifications.
yeah, 50ms is ok. My "microoptimized" O(n^3) solution (that must be arround N² on average, I guess) takes way longer than that, so it's ok against the expected time complexity.
About that, I don't know if this is that a spoiler. Even with that info, I have so far no idea about how to do that. x)
OK, closing. And I guess I'll never solve it. x)
In the sample test, some cases when
y == z
got1
So can a person attempt to hide a secret from self in this test?
Also when
x == y != z
got0
Did it mean that a person not knowing what himself wish to hide from another?
that part makes sense, I beleive. Tho, it stretches the logic of this sentence in the description:
it's logically incorrect (but contextually understandable, I guess) => "nobody but himself"
I think I got some kind of idea:
Change
Secrets
toSecrets on cards
;y attempts to hide from z
toAt the back of the card written "From y to z"
So a person may not know what the secret on the card is, when it wrote
"From 1 to 1"
at the backMaybe I am wrong...
Thank you for your feedback!
The kata description has been augmented by a section that addresses this logical edge case:
resolved.
the kata is currently totally undebuggable: the small random tests are already too big: if the user tries to print the input, here is what he's facing:
alongside of the above, the sample tests do not cover enough situations: I currently have a version that fails on one of those undebuggable thing.
So:
Cheers
n
) updated to a better fitresolved.
unpublishing, until the author can clarify the points below
as issues are resolved: republishing for more feedback.
tho, in the sample tests, there are cases where
x y y
is true, so "x knows a secret that y attempts to hide from himself" => that doesn't make sense x)=> something is wrong
resolved.
Hi,
This sentence is ambiguous:
he or she does not wish to disclose
to who that "he or she" is referring? the master, orP_i
?Cheers
Thank you for all your feedback!
resolved.
Thank you for your feedback!
resolved.