/**
 * Firefighter training exercise.
 *
 * You are a firefighter trying to extinguish a fire at a specific location.
 * Your task is to use a while loop with the !in operator to check if the fire is still burning.
 * If the fire is still burning, continue to extinguish it by pouring water from different locations.
 * The fire is considered extinguished once the fireLocation is no longer in the waterLocations list.
 *
 * @param fireLocation The location of the fire.
 * @param waterLocations List of locations with water sources.
 * @return The message indicating whether the fire was extinguished or not.
 */
fun extinguishFire(fireLocation: String, waterLocations: MutableList<String>): String {

    while (fireLocation !in waterLocations) {
        when (fireLocation) {
            "Fire Station" -> waterLocations.add("Fire Station")
            "Lake" -> waterLocations.add("Lake")
            "Hydrant" -> waterLocations.add("Hydrant")
            else -> waterLocations.add("Unknown")
        }
    }
    return "Fire extinguished successfully!"
}
/**
 * Firefighter training exercise.
 *
 * You are a firefighter trying to extinguish a fire at a specific location.
 * Your task is to use a while loop with the !in operator to check if the fire is still burning.
 * If the fire is still burning, continue to extinguish it by pouring water from different locations.
 * The fire is considered extinguished once the fireLocation is no longer in the waterLocations list.
 *
 * @param fireLocation The location of the fire.
 * @param waterLocations List of locations with water sources.
 * @return The message indicating whether the fire was extinguished or not.
 */
fun extinguishFire(fireLocation: String, waterLocations: MutableList<String>): String {
/**
 * Firefighter training exercise.
 *
 * You are a firefighter trying to extinguish a fire at a specific location.
 * Your task is to use a while loop with the !in operator to check if the fire is still burning.
 * If the fire is still burning, continue to extinguish it by pouring water from different locations.
 * The fire is considered extinguished once the fireLocation is no longer in the waterLocations list.
 *
 * @param fireLocation The location of the fire.
 * @param waterLocations List of locations with water sources.
 * @return The message indicating whether the fire was extinguished or not.
 */
fun extinguishFire(fireLocation: String, waterLocations: MutableList<String>): String {

    while (fireLocation !in waterLocations) {
        when (fireLocation) {
            "Fire Station" -> waterLocations.add("Fire Station")
            "Lake" -> waterLocations.add("Lake")
            "Hydrant" -> waterLocations.add("Hydrant")
            else -> waterLocations.add("Unknown")
        }
    }
    return "Fire extinguished successfully!"
}