Company: Visa__...
Difficulty: medium
Pairs With specific Sum Problem Description You are building a data analysis tool that needs to track relationships between two separate datasets. Your tool needs to support two operations: Update a value in the second dataset. Count matching pairs that satisfy a specific sum condition. Given two integer datasets primary and secondary , you need to implement a system that can: If the operation is of the form [0, index, newValue] , then secondary[index] should be assigned the value of newValue . If the operation is of the form [1, targetSum] , then find the total number of pairs of indices i and j such that: primary[i] + secondary[j] == targetSum You will be given the arrays of integers primary and secondary , as well as operations , an array of operations in either of the forms described above. Your task is to implement this system, perform the given operations, and return an array of the results of the operations of the type [1, targetSum] . Examples Example 1: Input: primary = [1, 2,