/**
 * Takes two artists and returns the intersection of their fans.
 *
 * @param artist1 Name of the first artist.
 * @param artist2 Name of the second artist.
 * @return Set of common fans between the two artists.
 */
fun intersection(artist1: String, artist2: String): Set<String> {

    val fansArtist1 = setOf("Zoe", "Nina", "John", "Alex", "Emma")
    val fansArtist2 = setOf("Nina", "John", "James", "Sophie", "Olivia")

    val commonFans = fansArtist1.intersect(fansArtist2)

    // Check if there are any common fans
    if (commonFans.isNotEmpty()) {
        println("$artist1 and $artist2 have the following fans in common:")
        commonFans.forEach { fan -> println(fan) }
    } else {
        println("There are no common fans between $artist1 and $artist2.")
    }

    return commonFans
}
/**
 * Takes two artists and returns the intersection of their fans.
 *
 * @param artist1 Name of the first artist.
 * @param artist2 Name of the second artist.
 * @return Set of common fans between the two artists.
 */
fun intersection(artist1: String, artist2: String): Set<String> {
/**
 * Takes two artists and returns the intersection of their fans.
 *
 * @param artist1 Name of the first artist.
 * @param artist2 Name of the second artist.
 * @return Set of common fans between the two artists.
 */
fun intersection(artist1: String, artist2: String): Set<String> {

    val fansArtist1 = setOf("Zoe", "Nina", "John", "Alex", "Emma")
    val fansArtist2 = setOf("Nina", "John", "James", "Sophie", "Olivia")

    val commonFans = fansArtist1.intersect(fansArtist2)

    // Check if there are any common fans
    if (commonFans.isNotEmpty()) {
        println("$artist1 and $artist2 have the following fans in common:")
        commonFans.forEach { fan -> println(fan) }
    } else {
        println("There are no common fans between $artist1 and $artist2.")
    }

    return commonFans
}