/**
 * Given two sets of animals 'animals' and 'mammals', this function returns a set
 * containing the mammals that appear in both sets.
 *
 * @param animals A set of animals.
 * @param mammals A set of mammals.
 * @return A set of mammals that appear in both 'animals' and 'mammals'.
 */
fun findCommonMammals(animals: Set<String>, mammals: Set<String>): Set<String> {

    // Initialize an empty set to store the common mammals found
    val commonMammals = mutableSetOf<String>()

    // Iterate over each animal in the 'animals' set
    for (animal in animals) {
        // Check if the current animal is a mammal
        if (animal in mammals) {
            // Add the mammal to the set of common mammals
            commonMammals.add(animal)
        }
    }

    return commonMammals
}
/**
 * Given two sets of animals 'animals' and 'mammals', this function returns a set
 * containing the mammals that appear in both sets.
 *
 * @param animals A set of animals.
 * @param mammals A set of mammals.
 * @return A set of mammals that appear in both 'animals' and 'mammals'.
 */
fun findCommonMammals(animals: Set<String>, mammals: Set<String>): Set<String> {
/**
 * Given two sets of animals 'animals' and 'mammals', this function returns a set
 * containing the mammals that appear in both sets.
 *
 * @param animals A set of animals.
 * @param mammals A set of mammals.
 * @return A set of mammals that appear in both 'animals' and 'mammals'.
 */
fun findCommonMammals(animals: Set<String>, mammals: Set<String>): Set<String> {

    // Initialize an empty set to store the common mammals found
    val commonMammals = mutableSetOf<String>()

    // Iterate over each animal in the 'animals' set
    for (animal in animals) {
        // Check if the current animal is a mammal
        if (animal in mammals) {
            // Add the mammal to the set of common mammals
            commonMammals.add(animal)
        }
    }

    return commonMammals
}