/**
 * Given a set of artists and a list of songs, this function finds the common elements
 * between the two by iterating through the set and using list methods.
 *
 * @param artistSet The set of artists
 * @param songsList The list of songs
 * @return A set containing the common elements between the artist set and the songs list
 */
fun findCommonElements(artistSet: Set<String>, songsList: List<String>): Set<String> {

    val commonElements = mutableSetOf<String>()  // Initialize an empty set to store the common elements

    for (artist in artistSet) {  // Iterate through each artist in the set
        for (song in songsList) {  // Iterate through each song in the list
            if (artist in song) {  // Check if the artist is present in the song
                commonElements.add(artist)  // Add the artist to the common elements set
            }
        }
    }

    return commonElements
}
/**
 * Given a set of artists and a list of songs, this function finds the common elements
 * between the two by iterating through the set and using list methods.
 *
 * @param artistSet The set of artists
 * @param songsList The list of songs
 * @return A set containing the common elements between the artist set and the songs list
 */
fun findCommonElements(artistSet: Set<String>, songsList: List<String>): Set<String> {
/**
 * Given a set of artists and a list of songs, this function finds the common elements
 * between the two by iterating through the set and using list methods.
 *
 * @param artistSet The set of artists
 * @param songsList The list of songs
 * @return A set containing the common elements between the artist set and the songs list
 */
fun findCommonElements(artistSet: Set<String>, songsList: List<String>): Set<String> {

    val commonElements = mutableSetOf<String>()  // Initialize an empty set to store the common elements

    for (artist in artistSet) {  // Iterate through each artist in the set
        for (song in songsList) {  // Iterate through each song in the list
            if (artist in song) {  // Check if the artist is present in the song
                commonElements.add(artist)  // Add the artist to the common elements set
            }
        }
    }

    return commonElements
}