Bisection - Least Runtime Solution
\nclass Solution:\n    def closestRoom(self, rooms: List[List[int]], queries: List[List[int]]) -> List[int]:\n        rooms.sort(key=lambda x: x[1], reverse=Tru
```\nclass Solution:\n    def closestRoom(self, rooms: List[List[int]], queries: List[List[int]]) -> List[int]:\n        rooms.sort(key=lambda x: x[1], reverse=True)  # Sort by decreasing order of room size\n        qArr = [[i, q] for i, q in enumerate(queries)]  # Zip queries with their index\n        qArr.sort(key=lambda x: x[1][1], reverse=True)  # Sort by decreasing order of query minSize\n\n        def searchClosestRoomId(preferredId):\n            if len(roomIdsSoFar) == 0:\n                return -1\n            cands = []\n            i = bisect_right(roomIdsSoFar, preferredId)\n            if i > 0:\n                cands.append(roomIdsSoFar[i - 1])\n            if i < len(roomIdsSoFar):\n                cands.append(roomIdsSoFar[i])\n            return min(cands, key=lambda x: abs(x - preferredId))\n\n        roomIdsSoFar = []  # Room id is sorted in increasing order\n        n, k = len(rooms), len(queries)\n        i = 0\n        ans = [-1] * k\n        for index, (prefferedId, minSize) in qArr:\n            while i < n and rooms[i][1] >= minSize:\n                bisect.insort(roomIdsSoFar, rooms[i][0])  # Add id of the room which its size >= query minSize\n                i += 1\n            ans[index] = searchClosestRoomId(prefferedId)\n        return ans\n```
[]