C# Binary Search
csharp\npublic class Solution\n{\n    List<int> weights = new();\n    List<int> starts = new();\n    List<int> ends = new();\n\n    public Solution(int n, int[]
```csharp\npublic class Solution\n{\n    List<int> weights = new();\n    List<int> starts = new();\n    List<int> ends = new();\n\n    public Solution(int n, int[] blacklist)\n    {\n        var weight = 0;\n        var start = 0;\n\n        foreach (var end in blacklist.Append(n).Order())\n        {\n            if (end > start)\n            {\n                weight += end - start;\n                weights.Add(weight);\n                starts.Add(start);\n                ends.Add(end);\n            }\n\n            start = end + 1;\n        }\n    }\n\n    public int Pick()\n    {\n        var random = Random.Shared.Next(weights[^1]);\n        var index = Math.Abs(weights.BinarySearch(random) + 1);\n        return Random.Shared.Next(starts[index], ends[index]);\n    }\n}\n```
['Binary Search', 'C#']