Easy Java Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    public int[] maximumBeauty(int[][] items, int[] queries) {\n        int []result= new int [queries.length];\n        int []prices = new int [items.length];\n        int[] max= new int[items.length +1];\n        Arrays.sort(items,(a,b) -> Integer.compare(a[0],b[0]));\n\n        for (int i=0;i<items.length;i++){\n            max[i+1]=Math.max(max[i],items[i][1]);\n\n        }\n        for (int i=0;i<queries.length;i++){\n            int a= binarySearch(items,queries[i]);\n            result[i]=max[a];\n        }\n        return result;\n    }\n\n    private int binarySearch(int[][] items, int b) {\n    int l = 0;\n    int r = items.length;\n    while (l < r) {\n      final int mid = (l + r) / 2;\n      if (items[mid][0] > b)\n        r = mid;\n      else\n        l = mid+ 1;\n    }\n    return l;\n  }\n}\n```
['Java']