Interesting Range Question | Random function | Simple and Precise
```\nclass Solution {\npublic:\n    vector> vec;\n    Solution(int n, vector& arr) {\n        int n_ = arr.size();\n        sort(arr.begin(),arr.end());\n      
```\nclass Solution {\npublic:\n    vector<pair<int,int>> vec;\n    Solution(int n, vector<int>& arr) {\n        int n_ = arr.size();\n        sort(arr.begin(),arr.end());\n        int l=0;\n        for(int i=0;i<n_;i++){\n            if(l == arr[i]){\n                l = arr[i]+1;\n                continue;\n            }\n            int r = arr[i]-1;\n            vec.push_back({l,r});\n            l = arr[i]+1;\n        }\n        if(l <= n-1){\n            vec.push_back({l,n-1});    \n        }\n        \n    }\n    \n    int pick() {\n        int o = vec.size();\n        int idx = rand();\n        idx=idx%o;\n        \n        int l = vec[idx].first;\n        int r = vec[idx].second;\n        \n        int diff = r-l+1;\n        \n        int num = rand()%diff;\n        return l + num;\n        \n    }\n};\n\n/**\n * Your Solution object will be instantiated and called as such:\n * Solution* obj = new Solution(n, blacklist);\n * int param_1 = obj->pick();\n */
[]