Simple approach - no HashMap, no rand calls
Split the main [0, n - 1] range into a list of valid ranges, by excluding the blacklist numbers.\nThen, just pick an index from the list, and a number from the 
Split the main `[0, n - 1]` range into a list of valid ranges, by excluding the blacklist numbers.\nThen, just pick an index from the list, and a number from the range associated with the chosen item. I used the current time **ticks** information to induce the randomness factor.\n\nPlease press **upvote** below if you liked this solution. **Thank you!**\n\n# Code\n```\npublic class Solution {\n\n    List<(int start, int end)> l = new();\n\n    public Solution(int n, int[] blacklist) \n    {\n        Array.Sort(blacklist);\n\n        var start = 0;\n        for(int i = 0; i < blacklist.Length; i++)\n        {\n            var end = blacklist[i] - 1;\n            if (start <= end)\n                l.Add(new (start, end));\n\t\t\tstart = blacklist[i] + 1;\n        }   \n\t\tif (start < n)\n\t\t\tl.Add(new (start, n - 1));    \n    }\n    \n    public int Pick() \n    {\n        int i = (int)(DateTime.Now.Ticks % l.Count);\n        var count = l[i].end - l[i].start + 1;\n        return l[i].start + (int)(DateTime.Now.Ticks % count);\n    }\n}\n\n```
['C#']