/**
 * Given two lists of species, find the common species using the XOR operator and conditional statements.
 *
 * @param speciesList1 A list containing the names of some species.
 * @param speciesList2 A list containing the names of some other species.
 * @return A list containing only the common species found in both lists.
 *
 * Example:
 * findCommonSpecies(listOf("Human", "Dog", "Cat", "Elephant", "Lion"), listOf("Dog", "Elephant", "Tiger", "Giraffe"))
 * Output: ["Dog", "Elephant"]
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {

    val commonSpecies = mutableListOf<String>()

    // Iterate over species in list 1
    for (species in speciesList1) {
        // Use XOR operator to check if species is present in both lists
        if (species in speciesList2) {
            commonSpecies.add(species)
        }
    }

    return commonSpecies
}
/**
 * Given two lists of species, find the common species using the XOR operator and conditional statements.
 *
 * @param speciesList1 A list containing the names of some species.
 * @param speciesList2 A list containing the names of some other species.
 * @return A list containing only the common species found in both lists.
 *
 * Example:
 * findCommonSpecies(listOf("Human", "Dog", "Cat", "Elephant", "Lion"), listOf("Dog", "Elephant", "Tiger", "Giraffe"))
 * Output: ["Dog", "Elephant"]
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {
/**
 * Given two lists of species, find the common species using the XOR operator and conditional statements.
 *
 * @param speciesList1 A list containing the names of some species.
 * @param speciesList2 A list containing the names of some other species.
 * @return A list containing only the common species found in both lists.
 *
 * Example:
 * findCommonSpecies(listOf("Human", "Dog", "Cat", "Elephant", "Lion"), listOf("Dog", "Elephant", "Tiger", "Giraffe"))
 * Output: ["Dog", "Elephant"]
 */
fun findCommonSpecies(speciesList1: List<String>, speciesList2: List<String>): List<String> {

    val commonSpecies = mutableListOf<String>()

    // Iterate over species in list 1
    for (species in speciesList1) {
        // Use XOR operator to check if species is present in both lists
        if (species in speciesList2) {
            commonSpecies.add(species)
        }
    }

    return commonSpecies
}