6 kyu
Unique sets
Loading description...
Lists
Arrays
Sets
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.
How is it different from any other kata about flattening collections?
This comment has been hidden.
I understand your point. Thank you for your feedback! I'm considering updating the challenge to incorporate all hashable compound types, such as named tuples and custom-created iterable hashable objects, to ensure that the task is even more authentic. May I ask, if this would resolve the issue? Please, let me know your thoughts!!
I see. Then if you believe this kata doesn't add value to the community, please let me know and I'll remove it (or vote it down). On the other hand, if you think the idea is beneficial, then I’d be happy to keep it and refine it further based on your feedback!
I personnaly am fine with it. As dfhwze pointed out, the way the task is described is enough of a twist to me.
You talk about
Such as tuples or frozensets,
. Does that mean there can also be other types of Iterables? It matters, since several solutions just hardcode the types you suggested. This should definately be clarified in the description.You are absolutely right, that's my bad. I changed the description. Does it sound okay now?
Yes, though a bit of a pitty you limit yourself to these types.
Objects need to be hashable. Unless one goes with custom types, tuples and frozensets are all that you can get (about iterables other than strings, I mean).
oh, but you wrote the code "backward" in the random tests.
Hence:
Hi! I am not sure why it shows up like that. For me, it shows as ` result1 = check_unique(arr)
` Is it the right way? Or I am not following it?
Oh, I got it, sorry. I will change it now
Should be fixed now. Did I make it correctly?
yes.
(Note : you should remove the commented out line in
generate_random_test
)Removed
Hi,
@test.it
blockcheers
Note: in the random tests, you should actually do this:
@test.it
blockThere, you never need to create any copy/deep copy.
Thank you for pointing out to this and for your explanation! I will unpublish it for a bit and fix all of the issues you underlined and I will make sure to avoid doing it in the future!
Fixed
(you need to publish again, to "undraft" it again)
Thank you!
There are 5-10 random tests that expect
True
even if there are duplicate values, e.g.:Thank you very much for telling!!! I will unpublish it and fix it!
Oh God, this was such a stupid bug. Irritatingly, I have already been solving it before but it seems that I forgot to save the changes. Thank you for pointing out!
I checked and it should be fixed now