/**
 * A firefighter is responding to an emergency situation. Complete the code below to implement the decision-making
 * logic based on the given conditions.
 *
 * @param enemiesDetected True if there are enemies present at the location, False otherwise.
 * @param smokeDetected True if smoke is detected in the building, False otherwise.
 * @param doorLocked True if the door is locked, False otherwise.
 * @param hasKey True if the firefighter has a key to open the locked door, False otherwise.
 * @param extinguisherAvailable True if the firefighter has an extinguisher, False otherwise.
 * @return A string describing the appropriate action for the firefighter to take.
 */
fun firefighterEmergency(enemiesDetected: Boolean, smokeDetected: Boolean, doorLocked: Boolean, hasKey: Boolean, extinguisherAvailable: Boolean): String {

    if (enemiesDetected) {
        if (extinguisherAvailable) {
            return "Attack the enemies with the extinguisher to eliminate the threat."
        } else {
            return "Call for backup, enemies detected and no extinguisher available."
        }
    } else {
        if (smokeDetected) {
            if (doorLocked) {
                if (hasKey) {
                    return "Open the locked door using the key and look for survivors or extinguish the fire."
                }
            }
        }
        return "No immediate action required."
    }
}
/**
 * A firefighter is responding to an emergency situation. Complete the code below to implement the decision-making
 * logic based on the given conditions.
 *
 * @param enemiesDetected True if there are enemies present at the location, False otherwise.
 * @param smokeDetected True if smoke is detected in the building, False otherwise.
 * @param doorLocked True if the door is locked, False otherwise.
 * @param hasKey True if the firefighter has a key to open the locked door, False otherwise.
 * @param extinguisherAvailable True if the firefighter has an extinguisher, False otherwise.
 * @return A string describing the appropriate action for the firefighter to take.
 */
fun firefighterEmergency(enemiesDetected: Boolean, smokeDetected: Boolean, doorLocked: Boolean, hasKey: Boolean, extinguisherAvailable: Boolean): String {
/**
 * A firefighter is responding to an emergency situation. Complete the code below to implement the decision-making
 * logic based on the given conditions.
 *
 * @param enemiesDetected True if there are enemies present at the location, False otherwise.
 * @param smokeDetected True if smoke is detected in the building, False otherwise.
 * @param doorLocked True if the door is locked, False otherwise.
 * @param hasKey True if the firefighter has a key to open the locked door, False otherwise.
 * @param extinguisherAvailable True if the firefighter has an extinguisher, False otherwise.
 * @return A string describing the appropriate action for the firefighter to take.
 */
fun firefighterEmergency(enemiesDetected: Boolean, smokeDetected: Boolean, doorLocked: Boolean, hasKey: Boolean, extinguisherAvailable: Boolean): String {

    if (enemiesDetected) {
        if (extinguisherAvailable) {
            return "Attack the enemies with the extinguisher to eliminate the threat."
        } else {
            return "Call for backup, enemies detected and no extinguisher available."
        }
    } else {
        if (smokeDetected) {
            if (doorLocked) {
                if (hasKey) {
                    return "Open the locked door using the key and look for survivors or extinguish the fire."
                }
            }
        }
        return "No immediate action required."
    }
}