Company: Salesforce_29july

Difficulty: easy

Problem Statement

Salesforce's Case Management System operates at a massive scale, processing up to a million cases per batch. To assign work efficiently, the operations team must quickly find the number of 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. Formally, count the number of index pairs (i, j) with i < j such that (resolutionTimes[i] + resolutionTimes[j]) % 60 == 0 . Because every resolution time is at least 1 , every pair sum is strictly positive, so the "non-zero" requirement is automatically satisfied. Input Format Read from standard input: The first line contains a single integer n , the number of cases. The second line contains n space-separated integers, the array resolutionTimes . Output Format Print a single integer: the number of valid pairs. The answer can be as large as n * (n - 1) / 2 , so

More Salesforce_29july OA questionsInterview experiences