C++✅ || Easy || Solution
\nclass ExamRoom {\nprivate:\n\tvector<int> v;\n\tint sz;\npublic:\n\tExamRoom(int n) {\n\t\tsz = n;\n\t}\n\n\tint seat() {\n\t\tif (v.size() == 0) {\n\t\t\tv.p
```\nclass ExamRoom {\nprivate:\n\tvector<int> v;\n\tint sz;\npublic:\n\tExamRoom(int n) {\n\t\tsz = n;\n\t}\n\n\tint seat() {\n\t\tif (v.size() == 0) {\n\t\t\tv.push_back(0);\n\t\t\treturn 0;\n\t\t}\n\t\tint maxi = max(v[0], sz - 1 - v.back());\n\t\tfor (int i = 0; i < v.size() - 1; ++i) maxi = max(maxi, (v[i + 1] - v[i]) >> 1);\n\n\t\tif (v[0] == maxi) {\n\t\t\tv.insert(v.begin(), 0);\n\t\t\treturn 0;\n\t\t}\n\n\t\tfor (int i = 0; i < v.size() - 1; ++i) {\n\t\t\tif (((v[i + 1] - v[i]) >> 1) == maxi) {\n\t\t\t\tv.insert(v.begin() + i + 1, (v[i + 1] + v[i]) >> 1);\n\t\t\t\treturn v[i + 1];\n\t\t\t}\n\t\t}\n\t\tv.push_back(sz - 1);\n\t\treturn sz - 1;\n\t}\n\n\tvoid leave(int p) {\n\t\tfor (int i = 0; i < v.size(); ++i) if (v[i] == p) v.erase(v.begin() + i);\n\t}\n};\n```
['C']