A couple of months ago, I wrote a post about Go and CPU Caches: https://teivah.medium.com/go-and-cpu-caches-af5d32cc5592
Then, I wanted to extend the scope of this post. Following this idea, I had the chance to give a talk to GopherCon Turkey 2020. The topic is the following: Mechanical Sympathy in Go.
I…
Problem
- Find the only element that appears once
In an unsorted array of integers, every element appears twice except for one element that appears only once. Return this element.Example:Input: a=[1, 4, 2, 4, 1, 3, 2]
Output: 3
- Category: Bit manipulation
Video: