/**
 * This function takes in two parameters: artists (a list) and songs (a map).
 * It returns a list of pairs containing the artist name and the corresponding song name.
 *
 * Complete the code below to access the elements of the list and map to solve the exercise.
 */
fun getSongInfo(artists: List<String>, songs: Map<String, List<String>>): List<Pair<String, String>> {

    val songInfo = mutableListOf<Pair<String, String>>()

    // Loop through the artists list
    for (artist in artists) {
        // Check if the artist is present in the songs map
        if (songs.containsKey(artist)) {
            // Access the artist's songs using the map key and append to the songInfo list
            for (song in songs[artist]!!) {
                // Append a pair of artist name and song name to the songInfo list
                songInfo.add(artist to song)
            }
        }
    }

    return songInfo
}
/**
 * This function takes in two parameters: artists (a list) and songs (a map).
 * It returns a list of pairs containing the artist name and the corresponding song name.
 *
 * Complete the code below to access the elements of the list and map to solve the exercise.
 */
fun getSongInfo(artists: List<String>, songs: Map<String, List<String>>): List<Pair<String, String>> {
/**
 * This function takes in two parameters: artists (a list) and songs (a map).
 * It returns a list of pairs containing the artist name and the corresponding song name.
 *
 * Complete the code below to access the elements of the list and map to solve the exercise.
 */
fun getSongInfo(artists: List<String>, songs: Map<String, List<String>>): List<Pair<String, String>> {

    val songInfo = mutableListOf<Pair<String, String>>()

    // Loop through the artists list
    for (artist in artists) {
        // Check if the artist is present in the songs map
        if (songs.containsKey(artist)) {
            // Access the artist's songs using the map key and append to the songInfo list
            for (song in songs[artist]!!) {
                // Append a pair of artist name and song name to the songInfo list
                songInfo.add(artist to song)
            }
        }
    }

    return songInfo
}