Search
⌘K

Leetcode 2736. Maximum Sum Queries

Given pairs (nums1[j], nums2[j]) with weight nums1[j]+nums2[j], answer each query by finding the maximum weight among points whose both coordinates are >= given thresholds — a 2D dominance max query problem. With n, q up to 1e5, it’s typically solved offline by sorting by one coordinate and using a segment tree / Fenwick or ordered map over the other coordinate to maintain range maximums.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.