/**
 * This function takes in two lists, 'firefighters' and 'waterAmounts', where 'firefighters' contains the names of the firefighters
 * and 'waterAmounts' contains the corresponding amount of water each firefighter has. The function should iterate through the firefighters
 * and check if the water amount is sufficient to extinguish a fire. If the water amount is not sufficient, the function should skip that firefighter
 * and move on to the next one. If the water amount is sufficient, the function should print the firefighter's name and the message 'Fire extinguished!'.
 * The function should return the total number of fires extinguished by all firefighters combined.
 */
fun extinguishFire(firefighters: List<String>, waterAmounts: List<Int>): Int {

    var totalFiresExtinguished = 0

    for ((index, firefighter) in firefighters.withIndex()) {
        val waterAmount = waterAmounts[index]
        if (waterAmount < 1000) {
            continue
        } else {
            println("$firefighter: Fire extinguished!")
            totalFiresExtinguished++
        }
    }

    return totalFiresExtinguished
}
/**
 * This function takes in two lists, 'firefighters' and 'waterAmounts', where 'firefighters' contains the names of the firefighters
 * and 'waterAmounts' contains the corresponding amount of water each firefighter has. The function should iterate through the firefighters
 * and check if the water amount is sufficient to extinguish a fire. If the water amount is not sufficient, the function should skip that firefighter
 * and move on to the next one. If the water amount is sufficient, the function should print the firefighter's name and the message 'Fire extinguished!'.
 * The function should return the total number of fires extinguished by all firefighters combined.
 */
fun extinguishFire(firefighters: List<String>, waterAmounts: List<Int>): Int {
/**
 * This function takes in two lists, 'firefighters' and 'waterAmounts', where 'firefighters' contains the names of the firefighters
 * and 'waterAmounts' contains the corresponding amount of water each firefighter has. The function should iterate through the firefighters
 * and check if the water amount is sufficient to extinguish a fire. If the water amount is not sufficient, the function should skip that firefighter
 * and move on to the next one. If the water amount is sufficient, the function should print the firefighter's name and the message 'Fire extinguished!'.
 * The function should return the total number of fires extinguished by all firefighters combined.
 */
fun extinguishFire(firefighters: List<String>, waterAmounts: List<Int>): Int {

    var totalFiresExtinguished = 0

    for ((index, firefighter) in firefighters.withIndex()) {
        val waterAmount = waterAmounts[index]
        if (waterAmount < 1000) {
            continue
        } else {
            println("$firefighter: Fire extinguished!")
            totalFiresExtinguished++
        }
    }

    return totalFiresExtinguished
}