/**
 * Given a list of animals and their species, create a dictionary where the keys are the species
 * and the values are the number of occurrences of each species in the list.
 *
 * @param animals A list of animals.
 * @param species A list of species corresponding to each animal in the 'animals' list.
 * @return A dictionary where the keys are the species and the values are the number of occurrences.
 */
fun getZoologistData(animals: List<String>, species: List<String>): Map<String, Int> {

    // Use set to get unique species from the list
    val uniqueSpecies = species.toSet()

    // Create a map to count occurrences of each species
    val speciesCount = uniqueSpecies.associateWith { sp -> species.count { it == sp } }

    return speciesCount
}
/**
 * Given a list of animals and their species, create a dictionary where the keys are the species
 * and the values are the number of occurrences of each species in the list.
 *
 * @param animals A list of animals.
 * @param species A list of species corresponding to each animal in the 'animals' list.
 * @return A dictionary where the keys are the species and the values are the number of occurrences.
 */
fun getZoologistData(animals: List<String>, species: List<String>): Map<String, Int> {
/**
 * Given a list of animals and their species, create a dictionary where the keys are the species
 * and the values are the number of occurrences of each species in the list.
 *
 * @param animals A list of animals.
 * @param species A list of species corresponding to each animal in the 'animals' list.
 * @return A dictionary where the keys are the species and the values are the number of occurrences.
 */
fun getZoologistData(animals: List<String>, species: List<String>): Map<String, Int> {

    // Use set to get unique species from the list
    val uniqueSpecies = species.toSet()

    // Create a map to count occurrences of each species
    val speciesCount = uniqueSpecies.associateWith { sp -> species.count { it == sp } }

    return speciesCount
}