You are given two 0-indexed integer arrays
nums1andnums2, each of lengthn, and a 1-indexed 2D arrayquerieswherequeries[i] = [xi, yi].For the
ithquery, find the maximum value ofnums1[j] + nums2[j]among all indicesj(0 <= j < n), wherenums1[j] >= xiandnums2[j] >= yi, or -1 if there is nojsatisfying the constraints.Return an array
answerwhereanswer[i]is the answer to theithquery.