Python 3   ||   3 lines, binary search, w/ example   ||   T/S: 80% / 58%
\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n\n                                                    
```\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n\n                                                    # Ex:      items = [[1,2],[3,2],[2,4],[5,6],[3,5]]\n\t\t\t\t\t\t\t\t\t\t\t\t\t#        queries = [1,2,3,4,5,6]\n\n        price, beauty = zip(*sorted(items))         # sorted(items = [[1,2],[2,4],[3,2],[3, 5],[5, 6]]\n                                                    # price = [1,2,3,3,5], beauty = [2,4,2,5,6]\n\n        beauty = list(accumulate(beauty,lambda x,y: max(x,y)))\n\t\t\n                                                    # beauty = [2,4,4,5,6]   \n        return [0 if q < price[0] else \n                beauty[bisect_right(price, q)-1] for q in queries]\n\t\t\t\t\n                                                    #   q       price[i]            beauty[i]\n                                                    #  \u2013\u2013\u2013\u2013     \u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013        \u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\u2013\n                                                    #    1      [ /1\\ ,2,3,3,5]     [ /2\\ ,4,4,5,6]\n                                                    #    2      [1, /2\\, 3,3,5]     [2, /4\\ ,4,5,6]\n                                                    #    3      [1,2,3, /3\\  5]     [2,4,4, /5\\ ,6]\n                                                    #    4      [1,2,3, /3\\ ,5]     [2,4,4, /5\\ ,6]\n                                                    #    5      [1,2,3,3, /5\\ ]     [2,4,4,5, /6\\ ]\n                                                    #    6      [1,2,3,3, /5\\ ]     [2,4,4,5, /6\\ ]\n\n                                                    #                        return [2,4,5,5,6,6]\n\n```\n[https://leetcode.com/problems/most-beautiful-item-for-each-query/submissions/1285375407/](https://leetcode.com/problems/most-beautiful-item-for-each-query/submissions/1285375407/)\n\nI could be wrong, but I think that time complexity is *O*((*N* + *M*) log *N*) and space complexity is *O*(*N*), in which *N* ~ `len(items)` and *M* ~ `len(queries)`.
['Python', 'Python3']