Solution with Beats 97% 🥳
Intuition\n Describe your first thoughts on how to solve this problem. \nSo if we sort the array we can easily get the value\n# Approach\n Describe your approac
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nSo if we sort the array we can easily get the value\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\nfirst I sorted the array and then finded the neartest greatest value if its checksu will be false or else 0 will be added\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\no(n<sup>2</sup>)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```python3 []\nclass Solution:\n    def maximumBeauty(self, items: List[List[int]], queries: List[int]) -> List[int]:\n\n        items=sorted(items,key=lambda x : x[1],reverse=True)\n\n        \n        res=[]\n        for i in queries:\n            check=True\n            for j in items:\n                if j[0]<=i:\n                    res.append(j[1])\n                    check=False\n                    break\n            if check:\n                res.append(0)\n        return res\n             \n\n        \n        \n```
['Python3']