Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Haha, bitwise xor. Since it's immutable and commutative it'll reduce down to the stray!
I should add that this only works because it’s an odd number of elements in the array. An even number of matching elements cancel each other out to result in the “stray”.
Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
XOR is a great idea, thanks!
Math for the win! :D
Well I can't think of a better answer for this particular problem domain.
What is this necromancy?
Haha, bitwise xor. Since it's immutable and commutative it'll reduce down to the stray!
I should add that this only works because it’s an odd number of elements in the array. An even number of matching elements cancel each other out to result in the “stray”.
Oh my, it even works in python!
This is one of those moments when I wish gifs worked better on Dev. But yay!
They should work in normal image markdown!
Whaaa?! How did I not know this! ...game changer
Same idea in Haskell: