A music player allows users to choose songs to
play but it has some rules. The songs must be
chosen in pairs and the pair's durations must
add up to a multiple of 60 seconds (e.g., 60, 120,
180). Given a list of song durations, calculate the
total number of different song pairs that can be
chosen.
Example
n=3
songs = [40, 20, 60]
Only one pair of songs has a combined duration
that is a multiple of a whole minute (40+ 20=
60, so return 1. While the third song is a single
minute long, songs must be chosen in pairs.
Function Description
Complete the function playlist in the editor
below.
playlist has the following parameter(s):
int songs[n]: the song durations in seconds
Returns:
int; the number of validConstraints
• 15n3105
1 ≤ songsti] ≤ 1000, where Osi
Input Format For Custom Testing
Input from stdin will be processed as follows
and passed to the function.
The next n lines each contain an integer that
describes songs[] and denotes the duration
of the fit song in seconds.
V Sample Case 0
Sample Input For Custom