Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1865. Finding Pairs With a Certain Sum
Design a data structure that supports point-add updates to nums2 and count queries that return how many pairs (i,j) satisfy nums1[i] + nums2[j] == tot. The challenge is to answer many updates/queries efficiently (nums1 is relatively small) by maintaining frequency bookkeeping rather than recomputing all pairs.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.