/**
 * This function takes the name, age, list of instruments played, list of genres
 * liked by the musician and the favorite genre. It returns a set of genres that
 * intersect between the genres liked by the musician and the favorite genre.
 */
fun musicianGenres(name: String, age: Int, instruments: List<String>, genres: List<String>, favGenre: String): Set<String> {

    // Create an empty set to store the intersecting genres
    val intersectingGenres = mutableSetOf<String>()

    // Iterate over each genre liked by the musician
    for (genre in genres) {
        // Check if the musician's favorite genre is also in the genres liked
        if (favGenre in genres) {
            // Check if the musician is old enough and plays multiple instruments
            // using ternary operator with multiple conditions
            if (age >= 18 && instruments.size > 1) {
                intersectingGenres.add(genre)
            }
        }
    }

    return intersectingGenres
}
/**
 * This function takes the name, age, list of instruments played, list of genres
 * liked by the musician and the favorite genre. It returns a set of genres that
 * intersect between the genres liked by the musician and the favorite genre.
 */
fun musicianGenres(name: String, age: Int, instruments: List<String>, genres: List<String>, favGenre: String): Set<String> {
/**
 * This function takes the name, age, list of instruments played, list of genres
 * liked by the musician and the favorite genre. It returns a set of genres that
 * intersect between the genres liked by the musician and the favorite genre.
 */
fun musicianGenres(name: String, age: Int, instruments: List<String>, genres: List<String>, favGenre: String): Set<String> {

    // Create an empty set to store the intersecting genres
    val intersectingGenres = mutableSetOf<String>()

    // Iterate over each genre liked by the musician
    for (genre in genres) {
        // Check if the musician's favorite genre is also in the genres liked
        if (favGenre in genres) {
            // Check if the musician is old enough and plays multiple instruments
            // using ternary operator with multiple conditions
            if (age >= 18 && instruments.size > 1) {
                intersectingGenres.add(genre)
            }
        }
    }

    return intersectingGenres
}