Daily challenge
\nfrom random import randrange\n\nclass Solution:\n\n    def __init__(self, n: int, blacklist: List[int]):\n        self.map = {}\n        for black in blacklis
```\nfrom random import randrange\n\nclass Solution:\n\n    def __init__(self, n: int, blacklist: List[int]):\n        self.map = {}\n        for black in blacklist:\n            self.map[black] = -1\n        last = n - 1\n        self.real_len = n - len(blacklist)\n        \n        for black in blacklist:\n            if black >= self.real_len:\n                continue\n            while last in self.map:\n                last -= 1\n            self.map[black] = last\n            last -= 1\n            \n    def pick(self) -> int:\n        rand = randrange(0, self.real_len)\n        if rand in self.map:\n            return self.map[rand]\n        return rand\n```\n\n\u5176\u5B9E\u76F4\u63A5init\u4E00\u4E2A\u6570\u7EC4\u7136\u540E\u628A\u6240\u6709\u7684black number\u79FB\u5230\u6700\u540E\u53BB\u4E5F\u53EF\u4EE5\n\u5C31\u4E0D\u7528dictionary\u4E86\n\u4F46\u662F\u5360\u7528\u7684\u7A7A\u95F4\u4F1A\u66F4\u5927
['Python']