/**
 * This function takes two lists of songs by different musicians and returns a new list
 * containing the songs that are common between both musicians. The function excludes any
 * duplicate songs in the output list.
 *
 * @param musician1 A list of songs by musician 1.
 * @param musician2 A list of songs by musician 2.
 * @return A new list containing the songs that are common between both musicians.
 */
fun findCommonSongs(musician1: List<String>, musician2: List<String>): List<String> {

    val commonSongs = mutableListOf<String>()

    // Loop through each song in musician1
    for (song in musician1) {
        // Check if the song is present in musician2 and is not already in commonSongs list
        if (song in musician2 && song !in commonSongs) {
            // Add the song to the commonSongs list
            commonSongs.add(song)
        }
    }

    return commonSongs
}
/**
 * This function takes two lists of songs by different musicians and returns a new list
 * containing the songs that are common between both musicians. The function excludes any
 * duplicate songs in the output list.
 *
 * @param musician1 A list of songs by musician 1.
 * @param musician2 A list of songs by musician 2.
 * @return A new list containing the songs that are common between both musicians.
 */
fun findCommonSongs(musician1: List<String>, musician2: List<String>): List<String> {
/**
 * This function takes two lists of songs by different musicians and returns a new list
 * containing the songs that are common between both musicians. The function excludes any
 * duplicate songs in the output list.
 *
 * @param musician1 A list of songs by musician 1.
 * @param musician2 A list of songs by musician 2.
 * @return A new list containing the songs that are common between both musicians.
 */
fun findCommonSongs(musician1: List<String>, musician2: List<String>): List<String> {

    val commonSongs = mutableListOf<String>()

    // Loop through each song in musician1
    for (song in musician1) {
        // Check if the song is present in musician2 and is not already in commonSongs list
        if (song in musician2 && song !in commonSongs) {
            // Add the song to the commonSongs list
            commonSongs.add(song)
        }
    }

    return commonSongs
}