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.
As much as I love the
foldl1' xor
solution, this one is faster because it doesn't have to traverse the whole list.This comment is hidden because it contains spoiler information about the solution
aleluya, nice
I'm so confused.
Hint II is now a 404 page.
This comment is hidden because it contains spoiler information about the solution
Oh, figured it out myself before I saw your reply, but thanks anyway.
Very clever and only O(n log n) time.
Don't forget the spoiler flag.
If it helps, here's a version of this solution with explicit arguments: https://www.codewars.com/kata/reviews/5daaddf3564ff100015dc8b2/groups/5daae6c7defe8100016bca2a
This comment is hidden because it contains spoiler information about the solution
Casting to Int via fromInteger makes it not work for bigger int types. using "genericTake" (from Data.List) instead of "take" is better.
Linear time instead of O(n log n) for sorting-based solutions. Bravo!
Yes. It uses the
(->)
andOrdering
Monoid
instances for that.Monoid
s rule.This comment is hidden because it contains spoiler information about the solution
Wonderful! If I understand correctly, "<>" means "then by" in this context?
Regular map would suffice.