Python Very Easy solution Using Lists
Runtime: 364 ms, faster than 37.72% of Python3 online submissions for Exam Room.\nMemory Usage: 14.2 MB, less than 98.78% of Python3 online submissions for Exam
**Runtime: 364 ms, faster than 37.72% of Python3 online submissions for Exam Room.\nMemory Usage: 14.2 MB, less than 98.78% of Python3 online submissions for Exam Room.**\n```\nclass ExamRoom:\n\n    def __init__(self, n: int):\n        self.n = n\n        self.lst = []\n\n    def seat(self) -> int:\n        if self.lst == []:\n            self.lst.append(0)\n            return 0\n        else:\n            index = 0 \n            diff = self.lst[0]\n            for i in range(1,len(self.lst)+1):\n                if i == len(self.lst):\n                    tmp = self.n - 1 - self.lst[i-1]\n                else:\n                    tmp = (self.lst[i] - self.lst[i-1])//2\n                if  tmp > diff:\n                    diff  = tmp\n                    index = i\n            #print(self.lst,diff,index)\n            if index ==0: \n                self.lst.insert(0,0)\n                return 0\n            elif index == len(self.lst):\n                self.lst.append(self.n-1)\n                return self.n-1\n            else:\n                self.lst.insert(index,self.lst[index-1]+diff)\n                return diff+self.lst[index-1]\n    def leave(self, p: int) -> None:\n        self.lst.remove(p)\n\n\n# Your ExamRoom object will be instantiated and called as such:\n# obj = ExamRoom(n)\n# param_1 = obj.seat()\n# obj.leave(p)\n```\n
['Python', 'Python3']