Simple - memory efficient - compute inefficient
\nclass Solution {\n    private int M;\n    private Random rnd;\n    private int[] blacklist;\n    \n    public Solution(int N, int[] blacklist) {\n        this
```\nclass Solution {\n    private int M;\n    private Random rnd;\n    private int[] blacklist;\n    \n    public Solution(int N, int[] blacklist) {\n        this.blacklist = blacklist;\n        M = N-blacklist.length;\n        rnd = new Random();\n        Arrays.sort(blacklist);\n    }\n    \n    public int pick() {\n        int r = rnd.nextInt(M);\n        for(int b : blacklist) if(b<=r) r++;\n        return r;\n    }\n}\n```
[]