LeetCode 710: Random Pick with Blacklist
Problem Restatement We need to design a class that randomly returns an integer from the range: [0, n - 1] Some values are blacklisted and cannot be returned. Every allowed value must have the same probability. The class supports: Operation Meaning Solution(n, blacklist) Initialize the picker pick() Return a uniformly random allowed value The challenge is to make pick() efficient. Input and Output Item Meaning Input Integer n Input Array...