Java Clean TM Solution
Complexity\n- Time complexity:O(sorting+n+m)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) 
# Complexity\n- Time complexity:$$O(sorting+n+m)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\n// TC:O(2n+SORTING)\n// SC:O(items.length)\nclass Solution {\n    public int[] maximumBeauty(int[][] items, int[] queries) {\n        Arrays.sort(items, (a, b) -> a[0] - b[0]);\n\n        int currMax = Integer.MIN_VALUE;\n        TreeMap<Integer, Integer> tm = new TreeMap<>();\n        tm.put(0, 0);\n        for (int[] item : items) {\n            currMax = Math.max(currMax, item[1]);\n            tm.put(item[0], currMax);\n        }\n\n        int[] res = new int[queries.length];\n        for (int i = 0; i < queries.length; i++) {\n            res[i] = tm.floorEntry(queries[i]).getValue();\n        }\n        return res;\n    }\n}\n```
['Array', 'Hash Table', 'Binary Search', 'Sorting', 'Hash Function', 'Java']