Amazon Online Assessment (OA) - Pairs of Songs With Total Durations Divisible by 60

Given a list of numbers and a target number. Find the number of pairs of numbers from the list whose sum is diviside by 60.

Example 1:

Input: [30,20,150,100,40]

Output: 3

Explanation:

(30, 150), (20, 100) and (20, 40) are pairs of numbers whose sum are divisible by 60.

Try it yourself

Solution