Simple and easy solution
Code\npython3 []\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n        mapp = defaultdict(int)\n\n   
# Code\n```python3 []\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n        mapp = defaultdict(int)\n\n        for p, b in items:\n            mapp[p] = max(mapp[p], b)\n\n        data = sorted(mapp.items())\n        i = 0\n        ans = [0] * len(queries)\n\n        max_beauty = 0\n        for q, ind in sorted([(q, i) for i, q in enumerate(queries)]):\n            while i < len(data) and data[i][0] <= q:\n                max_beauty = max(max_beauty, data[i][1])\n                i += 1\n\n            ans[ind] = max_beauty\n\n        return ans\n```
['Python3']