/**
 * This function takes a map of animals and returns a pair containing the last two values from the map.
 *
 * @param animalMap A map containing animal names as keys and animal species as values.
 * @return A pair containing the last two values from the map.
 *
 * Example:
 * get_last_two_values_from_map(mapOf("elephant" to "mammal", "crocodile" to "reptile", "penguin" to "bird"))
 * Output: Pair("reptile", "bird")
 */
fun getLastTwoValuesFromMap(animalMap: Map<String, String>): Pair<String, String>? {

    // Get the values from the map
    val values = animalMap.values.toList()

    // Check if the map has at least two values
    return if (values.size >= 2) {
        // Return the last two values using negative indexing
        Pair(values[values.size - 2], values.last())
    } else {
        null
    }
}
/**
 * This function takes a map of animals and returns a pair containing the last two values from the map.
 *
 * @param animalMap A map containing animal names as keys and animal species as values.
 * @return A pair containing the last two values from the map.
 *
 * Example:
 * get_last_two_values_from_map(mapOf("elephant" to "mammal", "crocodile" to "reptile", "penguin" to "bird"))
 * Output: Pair("reptile", "bird")
 */
fun getLastTwoValuesFromMap(animalMap: Map<String, String>): Pair<String, String>? {
/**
 * This function takes a map of animals and returns a pair containing the last two values from the map.
 *
 * @param animalMap A map containing animal names as keys and animal species as values.
 * @return A pair containing the last two values from the map.
 *
 * Example:
 * get_last_two_values_from_map(mapOf("elephant" to "mammal", "crocodile" to "reptile", "penguin" to "bird"))
 * Output: Pair("reptile", "bird")
 */
fun getLastTwoValuesFromMap(animalMap: Map<String, String>): Pair<String, String>? {

    // Get the values from the map
    val values = animalMap.values.toList()

    // Check if the map has at least two values
    return if (values.size >= 2) {
        // Return the last two values using negative indexing
        Pair(values[values.size - 2], values.last())
    } else {
        null
    }
}