/**
 * You are organizing a dance performance and you have a list of dancer names along with their skills.
 * Write a function that returns the names of the dancers who have at least one skill in common with the given
 * "dancerSkills" list. Use the unconditioned ternary operator to solve the exercise.
 *
 * @param dancerNames A list of strings representing the names of the dancers.
 * @param dancerSkills A list of lists where each inner list represents the skills of a dancer.
 * @return A list of strings containing the names of the dancers who have at least one skill in common with the given "dancerSkills" list.
 *
 * Example:
 * dancerNames = listOf("Alice", "Bob", "Charlie", "Daisy")
 * dancerSkills = listOf(listOf("ballet", "jazz"), listOf("hip-hop"), listOf("jazz", "tap"), listOf("hip-hop", "tap"))
 *
 * Output:
 * listOf("Alice", "Bob", "Charlie", "Daisy")
 */
fun dancerPerformance(dancerNames: List<String>, dancerSkills: List<List<String>>): List<String> {

    return dancerNames.filter { name ->
        dancerSkills.any { skills ->
            skills.any { skill -> skill in dancerSkills[0] }
        }
    }
}
/**
 * You are organizing a dance performance and you have a list of dancer names along with their skills.
 * Write a function that returns the names of the dancers who have at least one skill in common with the given
 * "dancerSkills" list. Use the unconditioned ternary operator to solve the exercise.
 *
 * @param dancerNames A list of strings representing the names of the dancers.
 * @param dancerSkills A list of lists where each inner list represents the skills of a dancer.
 * @return A list of strings containing the names of the dancers who have at least one skill in common with the given "dancerSkills" list.
 *
 * Example:
 * dancerNames = listOf("Alice", "Bob", "Charlie", "Daisy")
 * dancerSkills = listOf(listOf("ballet", "jazz"), listOf("hip-hop"), listOf("jazz", "tap"), listOf("hip-hop", "tap"))
 *
 * Output:
 * listOf("Alice", "Bob", "Charlie", "Daisy")
 */
fun dancerPerformance(dancerNames: List<String>, dancerSkills: List<List<String>>): List<String> {
/**
 * You are organizing a dance performance and you have a list of dancer names along with their skills.
 * Write a function that returns the names of the dancers who have at least one skill in common with the given
 * "dancerSkills" list. Use the unconditioned ternary operator to solve the exercise.
 *
 * @param dancerNames A list of strings representing the names of the dancers.
 * @param dancerSkills A list of lists where each inner list represents the skills of a dancer.
 * @return A list of strings containing the names of the dancers who have at least one skill in common with the given "dancerSkills" list.
 *
 * Example:
 * dancerNames = listOf("Alice", "Bob", "Charlie", "Daisy")
 * dancerSkills = listOf(listOf("ballet", "jazz"), listOf("hip-hop"), listOf("jazz", "tap"), listOf("hip-hop", "tap"))
 *
 * Output:
 * listOf("Alice", "Bob", "Charlie", "Daisy")
 */
fun dancerPerformance(dancerNames: List<String>, dancerSkills: List<List<String>>): List<String> {

    return dancerNames.filter { name ->
        dancerSkills.any { skills ->
            skills.any { skill -> skill in dancerSkills[0] }
        }
    }
}