/**
 * Calculate the total population of tribes that satisfy the given conditions.
 *
 * Given a list of populations of different tribes and two conditions,
 * this function calculates the total population of tribes that satisfy both conditions.
 *
 * @param populations A list of integers representing the population of tribes.
 * @param condition1 A function that takes an integer as an argument and returns a boolean value.
 * @param condition2 A function that takes an integer as an argument and returns a boolean value.
 * @return The total population of tribes that satisfy both conditions.
 */
fun calculateTribesPopulation(populations: List<Int>, condition1: (Int) -> Boolean, condition2: (Int) -> Boolean): Int {

    var totalPopulation = 0

    for (population in populations) {
        if (condition1(population) || condition2(population)) {
            totalPopulation += population
        }
    }

    return totalPopulation
}
/**
 * Calculate the total population of tribes that satisfy the given conditions.
 *
 * Given a list of populations of different tribes and two conditions,
 * this function calculates the total population of tribes that satisfy both conditions.
 *
 * @param populations A list of integers representing the population of tribes.
 * @param condition1 A function that takes an integer as an argument and returns a boolean value.
 * @param condition2 A function that takes an integer as an argument and returns a boolean value.
 * @return The total population of tribes that satisfy both conditions.
 */
fun calculateTribesPopulation(populations: List<Int>, condition1: (Int) -> Boolean, condition2: (Int) -> Boolean): Int {
/**
 * Calculate the total population of tribes that satisfy the given conditions.
 *
 * Given a list of populations of different tribes and two conditions,
 * this function calculates the total population of tribes that satisfy both conditions.
 *
 * @param populations A list of integers representing the population of tribes.
 * @param condition1 A function that takes an integer as an argument and returns a boolean value.
 * @param condition2 A function that takes an integer as an argument and returns a boolean value.
 * @return The total population of tribes that satisfy both conditions.
 */
fun calculateTribesPopulation(populations: List<Int>, condition1: (Int) -> Boolean, condition2: (Int) -> Boolean): Int {

    var totalPopulation = 0

    for (population in populations) {
        if (condition1(population) || condition2(population)) {
            totalPopulation += population
        }
    }

    return totalPopulation
}