Retired
Filter the array into unique values in 38 chars (retired)
398Peter Rhodes
Loading description...
Arrays
Fundamentals
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.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/136.
Please join the discussion to help us identify duplicate kata and retire them.
Retired.
Python translation
Check Unnamed solution, you should work with a copy of the array in the tests to forbid that kind of solutions.
Hi. Which of Unnamed's solutions? I don't think using lodash is a problem if it passes the test cases.
This comment has been hidden.
Well, I fixed it the way I suggested, I hope you don't mind.
No problem, thanks 👍
Fixed tests would have helped.
Great way to push people to read (search and read :)) ES6 documentation.
34 chars length also passed
Hey. Your solution is 32 chars long not including whitespace. Which solution passed with 34, I will try sorting it out? (Mark as having a spoiler)
I've changed the test cases now for code length now so this may no longer me an issue. The limit is now 38 chars but doesn't incluse whitespaces. Please could you test this for me?
I am going to presume that this issue is fixed as I have changed the test cases.
This is not new.
Doing it in 28 characters does not really add anything, because plenty of folks will write their solution to this problem like that anyway, at least here on CW.
Where are the days of Tidy up the room, when you had to actually create a compact algorithm, instead of using one or two monkey tricks on a chewed-out task?
Well, if the kata is too hard then nobody would be able to complete it, so it doesn't help either ;-)
(also, I just approved that kata ;-))
This comment has been hidden.
Have a look at (the solutions of) All unique or Unique items in array or Unique numbers or Remove duplicates.
Using a
Set
is definitely not the only way, but without a length restriction people are also coming up withSet
-based solutions (and lots of other ones).If you want to introduce people to
Set
s, would it not make more sense to allow them to submit any solution that works, they then submit, look at the top ranked solutions and go "Oooooh!"?Which has been done.
Personally I don't think looking at others solutions helps you to learn something as much as searching Stack Overflow and trying out some different solutions until you find one that works.
That is a valid point.
Johan,
There are lots of "make it shorter" kata versions of existing kata, they are not duplicates simply because some people code golf naturally.
They are not duplicates because they actually require you to use smart tricks for shortening the code. If I can go to a non-code-golf kata, copy somebody's solution from there, paste it here and pass the tests, then this kata is worthless.
And, as always, your constant issue-resolving is not helpful at all.
Also, usually when we mean
under x chars
we don't try to reduce user code ourselves anymore. It's up to the users to remove all the extra stuff themselves.Fixed this one too. Thanks for the help.
This comment has been hidden.
Fixed. Thanks Voile :)
Hey @Voile, is this issue still relevant today? I didn't know about that before.