/**
 * Given a list of pairs containing the names and ages of dancers, returns a new list
 * of names who are either below 20 years old or above 30 years old.
 *
 * @param dancers a list of pairs containing the names (String) and ages (Int) of dancers
 * @return a new list of names (String) who are either below 20 years old or above 30 years old
 */
fun checkDancerAge(dancers: List<Pair<String, Int>>): List<String> {

    // Initialize an empty list to store the names of eligible dancers
    val eligibleDancers = mutableListOf<String>()

    // Loop through each pair in the list
    for (dancer in dancers) {
        // Check if the age is below 20 or above 30
        if (dancer.second < 20 || dancer.second > 30) {
            // Add the dancer's name to the list of eligible dancers
            eligibleDancers.add(dancer.first)
        }
    }

    return eligibleDancers
}
/**
 * Given a list of pairs containing the names and ages of dancers, returns a new list
 * of names who are either below 20 years old or above 30 years old.
 *
 * @param dancers a list of pairs containing the names (String) and ages (Int) of dancers
 * @return a new list of names (String) who are either below 20 years old or above 30 years old
 */
fun checkDancerAge(dancers: List<Pair<String, Int>>): List<String> {
/**
 * Given a list of pairs containing the names and ages of dancers, returns a new list
 * of names who are either below 20 years old or above 30 years old.
 *
 * @param dancers a list of pairs containing the names (String) and ages (Int) of dancers
 * @return a new list of names (String) who are either below 20 years old or above 30 years old
 */
fun checkDancerAge(dancers: List<Pair<String, Int>>): List<String> {

    // Initialize an empty list to store the names of eligible dancers
    val eligibleDancers = mutableListOf<String>()

    // Loop through each pair in the list
    for (dancer in dancers) {
        // Check if the age is below 20 or above 30
        if (dancer.second < 20 || dancer.second > 30) {
            // Add the dancer's name to the list of eligible dancers
            eligibleDancers.add(dancer.first)
        }
    }

    return eligibleDancers
}