Insert delete getrandom O(1)
Design a set with insert, remove and getRandom (each element equally likely), all in average constant time, using an array of values and a map from value to index; remove by swapping with the last element.
No answer yet. Write the first one; the best answer gets endorsed.
