Solved.......🔥🔥🔥
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: 100%\u2705\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: 100%\u2705\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```c []\n/**\n * Note: The returned array must be malloced, assume caller calls free().\n */\nint compare(const void *a, const void *b) {\n    int *item1 = *(int **)a;\n    int *item2 = *(int **)b;\n    if (item1[0] == item2[0]) return item1[1] - item2[1];\n    return item1[0] - item2[0];\n}\n\nint* maximumBeauty(int** items, int itemsSize, int* itemsColSize, int* queries, int queriesSize, int* returnSize) {\n    qsort(items, itemsSize, sizeof(int*), compare);\n\n    int* maxBeauty = (int*)malloc(itemsSize * sizeof(int));\n    maxBeauty[0] = items[0][1];\n    for (int i = 1; i < itemsSize; i++) {\n        maxBeauty[i] = (maxBeauty[i - 1] > items[i][1]) ? maxBeauty[i - 1] : items[i][1];\n    }\n\n    int* res = (int*)malloc(queriesSize * sizeof(int));\n    *returnSize = queriesSize;\n    \n    for (int i = 0; i < queriesSize; i++) {\n        int q = queries[i];\n        int left = 0, right = itemsSize - 1;\n        while (left <= right) {\n            int mid = (left + right) / 2;\n            if (items[mid][0] <= q) left = mid + 1;\n            else right = mid - 1;\n        }\n        res[i] = (right >= 0) ? maxBeauty[right] : 0;\n    }\n\n    free(maxBeauty);\n    return res;\n}\n```
['Array', 'Binary Search', 'C', 'Sorting']