[Python3] Binary Search
\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n        \n        items.sort(key=lambda x: x[0])\n    
```\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n        \n        items.sort(key=lambda x: x[0])\n        a = []\n        b = []\n        \n        for i in range(len(items)):\n            a.append(items[i][0])\n            \n        for i in range(len(items)):\n            b.append(items[i][1])\n            \n        for i in range(1,len(b)):\n            if b[i] < b[i-1]:\n                b[i] = b[i-1]\n\n        idx = 0\n        \n        res = []\n        \n        for i in range(len(queries)):\n            \n            idx = bisect.bisect_right(a,queries[i])\n            \n            if idx == 0:\n                res.append(0)\n            else:\n                res.append(b[idx-1])\n        \n        return res\n```
[]