Python
Split [0,N) into [0,N-len(blacklist)) and [N-len(blacklist), N). The number of black items in left half == no. of whitelist items on right half. Hence just map 
Split [0,N) into [0,N-len(blacklist)) and [N-len(blacklist), N). The number of black items in left half == no. of whitelist items on right half. Hence just map the blacklist item on left side to a whitelist item on the  right side. \n```\n    def __init__(self, N: int, blacklist: List[int]):\n        self.blacklist = blacklist\n        self.B = len(blacklist)\n        self.N = N\n        self.mapping = {}\n        \n        second_hlf_wl = iter(set([i for i in range(N-self.B, N)]).difference(self.blacklist))\n\n        for n in blacklist:\n            if n<self.N-self.B:\n                self.mapping[n] = next(second_hlf_wl)       \n        \n    def pick(self) -> int:\n        x = random.randint(0, self.N - self.B-1) \n        if x in self.mapping:\n            return  self.mapping[x]\n        return x\n```
['Ordered Set', 'Python']