Company: Salesforce AMTS on-campus_16april
Difficulty: medium
Salesforce Pair Sums Salesforce's Case Management System now operates at a massive scale, processing up to a million cases per batch. To assign work efficiently, the operations team must quickly find distinct pairs of cases whose combined resolution times (in minutes) are a non-zero multiple of 60. Pairs are considered distinct by their indices. If two cases share the same resolution time, choosing a different index yields a new pair. Example n = 3 resolutionTimes = [30, 30, 60] Only one valid pair, indices (0, 1), sums to 60. Return 1. Function Description Complete the function multipleSums in the editor below. multipleSums(int resolutionTimes[n]) — list of integers representing case-resolution times Returns long: the number of valid pairs whose sum is a non-zero multiple of 60 Constraints 1 ≤ n ≤ 10 6 1 ≤ resolutionTimes[i] ≤ 10 9 The answer can be as large as n × (n - 1) / 2; store and return it in 64-bit (long) precision. Your algorithm must run in O(n) time