/**
 * Given a list of animals and a list of their classifications, create a map
 * where the keys are the classifications and the values are the animals belonging
 * to each classification.
 *
 * @param animalList A list of animals.
 * @param classificationList A list of the classifications of each animal.
 * @return A map with classifications as keys and a list of animals as values.
 */
fun zooAnimalsClassification(animalList: List<String>, classificationList: List<String>): Map<String, List<String>> {

    val animalClassification = mutableMapOf<String, MutableList<String>>()

    for ((animal, classification) in animalList.zip(classificationList)) {
        if (classification in animalClassification) {
            animalClassification[classification]?.add(animal)
        } else {
            animalClassification[classification] = mutableListOf(animal)
        }
    }

    return animalClassification
}
/**
 * Given a list of animals and a list of their classifications, create a map
 * where the keys are the classifications and the values are the animals belonging
 * to each classification.
 *
 * @param animalList A list of animals.
 * @param classificationList A list of the classifications of each animal.
 * @return A map with classifications as keys and a list of animals as values.
 */
fun zooAnimalsClassification(animalList: List<String>, classificationList: List<String>): Map<String, List<String>> {
/**
 * Given a list of animals and a list of their classifications, create a map
 * where the keys are the classifications and the values are the animals belonging
 * to each classification.
 *
 * @param animalList A list of animals.
 * @param classificationList A list of the classifications of each animal.
 * @return A map with classifications as keys and a list of animals as values.
 */
fun zooAnimalsClassification(animalList: List<String>, classificationList: List<String>): Map<String, List<String>> {

    val animalClassification = mutableMapOf<String, MutableList<String>>()

    for ((animal, classification) in animalList.zip(classificationList)) {
        if (classification in animalClassification) {
            animalClassification[classification]?.add(animal)
        } else {
            animalClassification[classification] = mutableListOf(animal)
        }
    }

    return animalClassification
}