/**
 * Given two lists of species found in two different habitats,
 * this function returns the species that are common to both habitats.
 *
 * @param speciesList1 A list of species found in the first habitat.
 * @param speciesList2 A list of species found in the second habitat.
 * @return A list of species that are common to both habitats.
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {

    val commonSpecies = mutableListOf<String>()

    for (species1 in speciesList1) {
        for (species2 in speciesList2) {
            if (species1 == species2) {
                commonSpecies.add(species1)
            }
        }
    }

    return commonSpecies
}
/**
 * Given two lists of species found in two different habitats,
 * this function returns the species that are common to both habitats.
 *
 * @param speciesList1 A list of species found in the first habitat.
 * @param speciesList2 A list of species found in the second habitat.
 * @return A list of species that are common to both habitats.
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {
/**
 * Given two lists of species found in two different habitats,
 * this function returns the species that are common to both habitats.
 *
 * @param speciesList1 A list of species found in the first habitat.
 * @param speciesList2 A list of species found in the second habitat.
 * @return A list of species that are common to both habitats.
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {

    val commonSpecies = mutableListOf<String>()

    for (species1 in speciesList1) {
        for (species2 in speciesList2) {
            if (species1 == species2) {
                commonSpecies.add(species1)
            }
        }
    }

    return commonSpecies
}