/**
 * Given a list of boolean functions and a list of updates,
 * update the boolean functions accordingly and return the updated list.
 *
 * @param booleanFunctions a list of boolean functions represented as strings
 * @param updates a map representing the updates, with each key as the boolean function name
 *               and each value as the update (true or false)
 * @return The updated list of boolean functions
 *
 * Example:
 * updateBooleanFunctions(listOf("A and B", "A or B"), mapOf("A and B" to false, "A or B" to true))
 * Output: ['A and B', 'A or B']
 */
fun updateBooleanFunctions(booleanFunctions: List<String>, updates: Map<String, Boolean>): List<String> {

    val updatedBooleanFunctions = mutableListOf<String>()
    for (func in booleanFunctions) {
        var updatedFunc = func
        for ((name, value) in updates) {
            if (name in updatedFunc) {
                updatedFunc = updatedFunc.replace(name, value.toString())
            }
        }
        updatedBooleanFunctions.add(updatedFunc)
    }
    return updatedBooleanFunctions
}
/**
 * Given a list of boolean functions and a list of updates,
 * update the boolean functions accordingly and return the updated list.
 *
 * @param booleanFunctions a list of boolean functions represented as strings
 * @param updates a map representing the updates, with each key as the boolean function name
 *               and each value as the update (true or false)
 * @return The updated list of boolean functions
 *
 * Example:
 * updateBooleanFunctions(listOf("A and B", "A or B"), mapOf("A and B" to false, "A or B" to true))
 * Output: ['A and B', 'A or B']
 */
fun updateBooleanFunctions(booleanFunctions: List<String>, updates: Map<String, Boolean>): List<String> {
/**
 * Given a list of boolean functions and a list of updates,
 * update the boolean functions accordingly and return the updated list.
 *
 * @param booleanFunctions a list of boolean functions represented as strings
 * @param updates a map representing the updates, with each key as the boolean function name
 *               and each value as the update (true or false)
 * @return The updated list of boolean functions
 *
 * Example:
 * updateBooleanFunctions(listOf("A and B", "A or B"), mapOf("A and B" to false, "A or B" to true))
 * Output: ['A and B', 'A or B']
 */
fun updateBooleanFunctions(booleanFunctions: List<String>, updates: Map<String, Boolean>): List<String> {

    val updatedBooleanFunctions = mutableListOf<String>()
    for (func in booleanFunctions) {
        var updatedFunc = func
        for ((name, value) in updates) {
            if (name in updatedFunc) {
                updatedFunc = updatedFunc.replace(name, value.toString())
            }
        }
        updatedBooleanFunctions.add(updatedFunc)
    }
    return updatedBooleanFunctions
}