Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
nice one
Great solution! Thanks!
the same solution
Seems like we caught a red-handed time traveller :-)
chatGPT wasn't a thing in 2017...
Looks like ChatGPT solution
In my first attempt i've used 2 filters — 1) return all elements that are the same as current 2) if returned array length === 1, then return current element (it appears only once). And then reduce.
I think, your solution with only one filter is 1) much more cleaner and 2) better perfomance. But I'm not sure about perfomace.
This comment is hidden because it contains spoiler information about the solution
The shortness isn't the main benefit. The "n" value might be "null" or "undefined" as instance so an exception will be raised for the best. This solution is more safefull. However we can get unexpected results: 9 for "undefined" and 4 for "null".
That's even shorter than the best of
Best Practices
! Neat!Good one buddy
This comment is hidden because it contains spoiler information about the solution
This is so smart🙌🏻
No, it isn't.
So then... Is it really a best practice?
Loading more items...