C++ || Simplest Solution || No hashmap || No binary search
\nclass Solution {\npublic:\n    vector<vector<int>> v;\n    \n    Solution(int n, vector<int>& b) {\n        sort(b.begin(),b.end());\n        int pre=0;\n    
```\nclass Solution {\npublic:\n    vector<vector<int>> v;\n    \n    Solution(int n, vector<int>& b) {\n        sort(b.begin(),b.end());\n        int pre=0;\n        for(auto &i:b){\n            if(i-1>=pre){\n                v.push_back({pre,i-1});\n            }\n            pre=i+1;\n        }\n        if(pre<=n-1)v.push_back({pre,n-1});\n    }\n    \n    int pick() {\n        int idx=rand()%(v.size());\n        int ans=rand()%(v[idx][1]-v[idx][0]+1)+v[idx][0];\n        return ans;\n    }\n};\n\n```
[]