Javascript solution using map - 316 - 324 ms
Idea is similar to top rated solution, but remap is done on pick call:\n\nvar Solution = function(N, blacklist) {\n    this.count = N - blacklist.length;\n    t
Idea is similar to top rated solution, but remap is done on pick call:\n```\nvar Solution = function(N, blacklist) {\n    this.count = N - blacklist.length;\n    this.lastMappingIndex = N - 1;\n    this.map = Object.create(null);\n    for (var num of blacklist) {\n        this.map[num] = null;\n    }\n};\n\n/**\n * @return {number}\n */\nSolution.prototype.pick = function() {\n    var num; \n    \n    while (this.map[(num = Math.random() * this.count >> 0)] !== undefined) {\n        if (this.map[num] === null) {\n            while (this.map[this.lastMappingIndex] !== undefined) {\n                this.lastMappingIndex--;\n            }\n            \n            this.map[num] = this.lastMappingIndex--;\n        }\n        \n        return this.map[num];\n    }\n    \n    return num;\n};\n```
[]