/**
 * A firefighter needs to extinguish fires in a row, given the distance of each fire and the total number of fires.
 *
 * @param distance The distance to each fire.
 * @param numFires The total number of fires.
 * @return The number of fires extinguished before a break is encountered.
 */
fun extinguishFire(distance: List<Int>, numFires: Int): Int {

    var firesExtinguished = 0
    var totalDistance = 0
    var i = 0
    while (i < numFires) {
        totalDistance += distance[i]
        if (totalDistance >= 100) {
            break
        }
        firesExtinguished++
        i++
    }
    return firesExtinguished
}
/**
 * A firefighter needs to extinguish fires in a row, given the distance of each fire and the total number of fires.
 *
 * @param distance The distance to each fire.
 * @param numFires The total number of fires.
 * @return The number of fires extinguished before a break is encountered.
 */
fun extinguishFire(distance: List<Int>, numFires: Int): Int {
/**
 * A firefighter needs to extinguish fires in a row, given the distance of each fire and the total number of fires.
 *
 * @param distance The distance to each fire.
 * @param numFires The total number of fires.
 * @return The number of fires extinguished before a break is encountered.
 */
fun extinguishFire(distance: List<Int>, numFires: Int): Int {

    var firesExtinguished = 0
    var totalDistance = 0
    var i = 0
    while (i < numFires) {
        totalDistance += distance[i]
        if (totalDistance >= 100) {
            break
        }
        firesExtinguished++
        i++
    }
    return firesExtinguished
}