O(N)/O(1), map, golang
\nimport (\n    "fmt"\n    "math/rand"\n)\n\ntype Solution struct {\n    n int\n    subst map[int]int\n}\n\nfunc Constructor(N int, b []int) Solution {\n\ts := 
```\nimport (\n    "fmt"\n    "math/rand"\n)\n\ntype Solution struct {\n    n int\n    subst map[int]int\n}\n\nfunc Constructor(N int, b []int) Solution {\n\ts := Solution{\n\t\tn:     N - len(b),\n\t\tsubst: make(map[int]int),\n\t}\n\n\tfor _, v := range b {\n\t\ts.subst[v] = -1\n\t}\n\n\tfor _, v := range b {\n\t\tif v < s.n {\n\t\t\tfor N > 0 {\n\t\t\t\tN--\n\t\t\t\tif _, ok := s.subst[N]; !ok {\n\t\t\t\t\ts.subst[v] = N\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\treturn s\n}\n\nfunc (this *Solution) Pick() int {\n    r := rand.Intn(this.n)\n    if val, ok := this.subst[r]; ok {\n        return val\n    }\n    return r\n}\n\n/**\n * Your Solution object will be instantiated and called as such:\n * obj := Constructor(N, blacklist);\n * param_1 := obj.Pick();\n */\n ```
['Go']