/**
 * This function takes a list of firefighters' information and a dictionary of updates.
 * It updates the firefighters' information based on the given updates dictionary.
 * The function returns the updated list of firefighters' information.
 *
 * @param firefighters List of dictionaries with firefighters' information.
 * @param updates Dictionary of updates to be applied on firefighters' information.
 * @return Updated list of firefighters' information.
 */
fun firefighterOperation(firefighters: List<MutableMap<String, Any>>, updates: Map<String, Any>): List<MutableMap<String, Any>> {

    // Iterate over each firefighter in the list
    for (firefighter in firefighters) {
        // Iterate over each key-value pair in the updates dictionary
        for ((key, value) in updates) {
            // Only update if the key exists in the firefighter's information dictionary
            if (firefighter.containsKey(key)) {
                // Update the corresponding value in the firefighter's information
                firefighter[key] = value
            }
        }
    }

    return firefighters
}

// Example usage of the firefighterOperation function
/**
 * This function takes a list of firefighters' information and a dictionary of updates.
 * It updates the firefighters' information based on the given updates dictionary.
 * The function returns the updated list of firefighters' information.
 *
 * @param firefighters List of dictionaries with firefighters' information.
 * @param updates Dictionary of updates to be applied on firefighters' information.
 * @return Updated list of firefighters' information.
 */
fun firefighterOperation(firefighters: List<MutableMap<String, Any>>, updates: Map<String, Any>): List<MutableMap<String, Any>> {
/**
 * This function takes a list of firefighters' information and a dictionary of updates.
 * It updates the firefighters' information based on the given updates dictionary.
 * The function returns the updated list of firefighters' information.
 *
 * @param firefighters List of dictionaries with firefighters' information.
 * @param updates Dictionary of updates to be applied on firefighters' information.
 * @return Updated list of firefighters' information.
 */
fun firefighterOperation(firefighters: List<MutableMap<String, Any>>, updates: Map<String, Any>): List<MutableMap<String, Any>> {

    // Iterate over each firefighter in the list
    for (firefighter in firefighters) {
        // Iterate over each key-value pair in the updates dictionary
        for ((key, value) in updates) {
            // Only update if the key exists in the firefighter's information dictionary
            if (firefighter.containsKey(key)) {
                // Update the corresponding value in the firefighter's information
                firefighter[key] = value
            }
        }
    }

    return firefighters
}

// Example usage of the firefighterOperation function