C++ solution - index remapping
\nclass Solution {\npublic:\n    unordered_map<int,int> mapper;\n    random_device rd;\n    mt19937 gen;\n    int size;\n    \n    Solution(int N, vector<int>& 
```\nclass Solution {\npublic:\n    unordered_map<int,int> mapper;\n    random_device rd;\n    mt19937 gen;\n    int size;\n    \n    Solution(int N, vector<int>& blacklist):gen(rd()),size(N - blacklist.size()) {\n        int counter = N - blacklist.size();\n        unordered_set<int> bl(begin(blacklist),end(blacklist));\n        \n        for(auto &b : blacklist){\n            if(b < N - blacklist.size()){\n                while(bl.count(counter)){\n                    counter++;\n                }        \n                \n                mapper[b] = counter++;\n            }\n        }\n    }\n    \n    int pick() {\n        uniform_int_distribution<int> uid(0,size - 1);\n        int ret = uid(gen);\n        \n        if(mapper.count(ret)){\n            return mapper[ret];\n        }\n        \n        return ret;\n    }\n};\n```
[]