[CS Academy] Letters DequeRead more
[CS Academy] Hamming DistancesRead more
[CS Academy] Graph GameRead more
[CS Academy] Triangular UpdatesRead more
[Codeforces] Abbyy Cup 2.0 - Final (unofficial) D9. The Beaver`s Problem - 3Read more
[Codeforces] Abbyy Cup 2.0 - Final (unofficial) D1. The Beaver`s Problem - 3Read more
[Codeforces] Round 133 (Div. 2) C. Hiring StaffRead more
[Codeforces] Round 136 (Div. 1) B. Little Elephant and ArrayRead more
[Codeforces] Round 137 (Div. 2) C. Reducing FractionsRead more
[LeetCode] Maximum Sum Queries

2736. Maximum Sum Queries

You are given two 0-indexed integer arrays nums1 and nums2, each of length n, and a 1-indexed 2D array queries where queries[i] = [xi, yi].

For the ith query, find the maximum value of nums1[j] + nums2[j] among all indices j (0 <= j < n), where nums1[j] >= xi and nums2[j] >= yi, or -1 if there is no j satisfying the constraints.

Return an array answer where answer[i] is the answer to the ith query.

Read more