Most Complex Question Till Now (soln)
If u can understand this solution easily then u should stop dude...XD :)\n`\nclass ExamRoom {\npublic:\n    set<int> s;\n\n    int n;\n    ExamRoom(int N) {\n  
If u can understand this solution easily then u should stop dude...XD :)\n```\nclass ExamRoom {\npublic:\n    set<int> s;\n\n    int n;\n    ExamRoom(int N) {\n        n=N;\n      \n    }\n    \n    int seat() {\n        if(s.empty())\n        {\n            s.insert(0);\n            return 0;\n        }\n        int x=-1;\n        int prev=-1;\n        int maxdis=INT_MIN;\n        if(*(s.begin())>0)\n        {\n            x=0;\n            maxdis=*(s.begin())-1;\n        }\n        for(auto it: s)\n        {\n            //cout<<it<<endl;\n            if((it-prev-1)>0)\n            {\n                if(((it-prev-1)%2==0 && ((it-prev-1)/2-1)>maxdis) || ((it-prev-1)%2!=0 && ((it-prev-1)/2)>maxdis))\n                {\n                   \n                    \n                    if((it-prev-1)%2==0)\n                    {\n                         maxdis=(it-prev-1)/2 -1;\n                        x=prev+(it-prev-1)/2;\n                    }\n                    else\n                    {\n                         maxdis=(it-prev-1)/2;\n                        x=prev+maxdis+1; \n                    }\n                   // cout<<maxdis<<" "<<prev<<endl;\n                }\n            }\n           prev=it;\n        }\n         if((n-prev-1)>0)\n            {\n                if((n-prev-2)>maxdis)\n                {\n                    x=n-1;\n                }\n            }\n       \n        s.insert(x);\n        //cout<<endl;\n        return x;\n    }\n    \n    void leave(int p) {\n        s.erase(p);\n    }\n};\n\n/**\n * Your ExamRoom object will be instantiated and called as such:\n * ExamRoom* obj = new ExamRoom(n);\n * int param_1 = obj->seat();\n * obj->leave(p);\n */\n ``
['C', 'Ordered Set']