Simple Python Solution | Dictionary/Map | O(n) time O(1) space
\nimport random\nclass Solution:\n    # hashmap to represent reflected value \n    # to simulate pushing elements to the end (to enhance intimacy of group of el
```\nimport random\nclass Solution:\n    # hashmap to represent reflected value \n    # to simulate pushing elements to the end (to enhance intimacy of group of elements)\n    def __init__(self, n: int, blacklist: List[int]):\n        # [0, self.white - 1] is whitelist, [white, n - 1] is blacklist\n        self.white = n - len(blacklist)\n        self.dict = {}\n        last = n - 1\n\n        for b in blacklist:\n            self.dict[b] = -1                       # mark blacklist\n        \n        for b in blacklist:\n            if b >= self.white:                     # in the range of blacklist, leave it, as we won\'t pick a rand in the range of blacklist\n                continue\n            \n            while last in self.dict:                # last is in blacklist\n                last -= 1                           # reduce last so the element won\'t repeat\n\n            self.dict[b] = last                     # reflect blacklist to the white\n            last -= 1                               # reduce last so the element won\'t repeat\n\n    def pick(self) -> int:\n        rand = random.randint(0, self.white - 1)    # only pick in the range of [0, self.white - 1]\n        if rand in self.dict:\n            return self.dict[rand]                  # return the reflected value\n        return rand\n\n\n# Your Solution object will be instantiated and called as such:\n# obj = Solution(n, blacklist)\n# param_1 = obj.pick()\n```
[]