/**
 * This function takes a tuple of athlete names and a string of common characters as input.
 * It finds and returns a list of athlete names that contain all the common characters.
 */
fun findCommonCharacters(athleteNames: List<String>, commonLetters: String): List<String> {

    val commonAthletes = mutableListOf<String>()  // Initialize an empty list to store athlete names

    // Iterate over each athlete name in the list
    for (name in athleteNames) {
        var allFound = true  // Initialize a boolean variable to keep track of whether all common characters are found

        // Iterate over each common character in the string
        for (char in commonLetters) {
            // Check if the current common character is not present in the current athlete name
            if (char !in name) {
                // If any common character is not found, set allFound to false and break the loop
                allFound = false
                break
            }
        }

        // If all common characters are found in the current athlete name, add it to the commonAthletes list
        if (allFound) {
            commonAthletes.add(name)
        }
    }

    return commonAthletes
}
/**
 * This function takes a tuple of athlete names and a string of common characters as input.
 * It finds and returns a list of athlete names that contain all the common characters.
 */
fun findCommonCharacters(athleteNames: List<String>, commonLetters: String): List<String> {
/**
 * This function takes a tuple of athlete names and a string of common characters as input.
 * It finds and returns a list of athlete names that contain all the common characters.
 */
fun findCommonCharacters(athleteNames: List<String>, commonLetters: String): List<String> {

    val commonAthletes = mutableListOf<String>()  // Initialize an empty list to store athlete names

    // Iterate over each athlete name in the list
    for (name in athleteNames) {
        var allFound = true  // Initialize a boolean variable to keep track of whether all common characters are found

        // Iterate over each common character in the string
        for (char in commonLetters) {
            // Check if the current common character is not present in the current athlete name
            if (char !in name) {
                // If any common character is not found, set allFound to false and break the loop
                allFound = false
                break
            }
        }

        // If all common characters are found in the current athlete name, add it to the commonAthletes list
        if (allFound) {
            commonAthletes.add(name)
        }
    }

    return commonAthletes
}