/**
 * Given a list of dancers and a list of their respective skills, determine the dancers who have a specific set of skills.
 *
 * @param dancerList A list of dancers.
 * @param skillsList A list of skills.
 * @return A list of dancers who possess all the skills.
 */
fun dancerSkills(dancerList: List<String>, skillsList: List<Map<String, Int>>): List<String> {

    val requiredSkills = listOf("Jump", "Spin", "Split")
    val qualifiedDancers = mutableListOf<String>()

    for ((index, dancer) in dancerList.withIndex()) {
        var hasSkills = true

        for (skill in requiredSkills) {
            if (skillsList[index][skill] == null || skillsList[index][skill]!! < 5) {
                hasSkills = false
                break
            }
        }

        if (hasSkills) {
            qualifiedDancers.add(dancer)
        }
    }

    return qualifiedDancers
}

// Example Usage
val dancers = listOf("Alice", "Bob", "Catherine", "David")
val skills = listOf(
    mapOf("Jump" to 8, "Spin" to 9, "Split" to 7),
    mapOf("Jump" to 7, "Spin" to 8, "Split" to 6),
    mapOf("Jump" to 9, "Spin" to 9, "Split" to 8)
)
/**
 * Given a list of dancers and a list of their respective skills, determine the dancers who have a specific set of skills.
 *
 * @param dancerList A list of dancers.
 * @param skillsList A list of skills.
 * @return A list of dancers who possess all the skills.
 */
fun dancerSkills(dancerList: List<String>, skillsList: List<Map<String, Int>>): List<String> {
/**
 * Given a list of dancers and a list of their respective skills, determine the dancers who have a specific set of skills.
 *
 * @param dancerList A list of dancers.
 * @param skillsList A list of skills.
 * @return A list of dancers who possess all the skills.
 */
fun dancerSkills(dancerList: List<String>, skillsList: List<Map<String, Int>>): List<String> {

    val requiredSkills = listOf("Jump", "Spin", "Split")
    val qualifiedDancers = mutableListOf<String>()

    for ((index, dancer) in dancerList.withIndex()) {
        var hasSkills = true

        for (skill in requiredSkills) {
            if (skillsList[index][skill] == null || skillsList[index][skill]!! < 5) {
                hasSkills = false
                break
            }
        }

        if (hasSkills) {
            qualifiedDancers.add(dancer)
        }
    }

    return qualifiedDancers
}

// Example Usage
val dancers = listOf("Alice", "Bob", "Catherine", "David")
val skills = listOf(
    mapOf("Jump" to 8, "Spin" to 9, "Split" to 7),
    mapOf("Jump" to 7, "Spin" to 8, "Split" to 6),
    mapOf("Jump" to 9, "Spin" to 9, "Split" to 8)
)