3
* @param {number[]} blacklist5
var Solution = function (n, blacklist) {6
this.space = n - blacklist.length;9
blacklist.forEach((b, i) => {10
const next = this.space + i;12
const head = this.map[b] === undefined ? b : this.map[b];13
const tail = this.map[next] === undefined ? next : this.map[next];15
this.map[head] = tail;16
this.map[tail] = head;23
Solution.prototype.pick = function () {24
const result = Math.floor(Math.random() * this.space);25
return this.map[result] || result;29
* Your Solution object will be instantiated and called as such:30
* var obj = new Solution(n, blacklist)31
* var param_1 = obj.pick()