/**
 * Determines whether it is safe for a firefighter to enter a building on fire.
 *
 * This function takes three boolean parameters: buildingOnFire, fireExtinguisherAvailable, and fireExitOpen.
 * It returns true if it is safe to enter the building, otherwise it returns false.
 *
 * Conditions:
 * 1. If the building is not on fire, it is safe to enter irrespective of other conditions.
 * 2. If the building is on fire and the fire extinguisher is not available, it is not safe to enter.
 * 3. If the building is on fire and the fire extinguisher is available, it is safe to enter if the fire exit is open.
 * 4. If the building is on fire and the fire extinguisher is available, it is not safe to enter if the fire exit is closed.
 *
 * Hint: Use short-circuiting and short-circuiting with if-else to solve this exercise.
 */
fun isSafeToEnter(buildingOnFire: Boolean, fireExtinguisherAvailable: Boolean, fireExitOpen: Boolean): Boolean {

    return !buildingOnFire || (buildingOnFire && fireExtinguisherAvailable && fireExitOpen)
}
/**
 * Determines whether it is safe for a firefighter to enter a building on fire.
 *
 * This function takes three boolean parameters: buildingOnFire, fireExtinguisherAvailable, and fireExitOpen.
 * It returns true if it is safe to enter the building, otherwise it returns false.
 *
 * Conditions:
 * 1. If the building is not on fire, it is safe to enter irrespective of other conditions.
 * 2. If the building is on fire and the fire extinguisher is not available, it is not safe to enter.
 * 3. If the building is on fire and the fire extinguisher is available, it is safe to enter if the fire exit is open.
 * 4. If the building is on fire and the fire extinguisher is available, it is not safe to enter if the fire exit is closed.
 *
 * Hint: Use short-circuiting and short-circuiting with if-else to solve this exercise.
 */
fun isSafeToEnter(buildingOnFire: Boolean, fireExtinguisherAvailable: Boolean, fireExitOpen: Boolean): Boolean {
/**
 * Determines whether it is safe for a firefighter to enter a building on fire.
 *
 * This function takes three boolean parameters: buildingOnFire, fireExtinguisherAvailable, and fireExitOpen.
 * It returns true if it is safe to enter the building, otherwise it returns false.
 *
 * Conditions:
 * 1. If the building is not on fire, it is safe to enter irrespective of other conditions.
 * 2. If the building is on fire and the fire extinguisher is not available, it is not safe to enter.
 * 3. If the building is on fire and the fire extinguisher is available, it is safe to enter if the fire exit is open.
 * 4. If the building is on fire and the fire extinguisher is available, it is not safe to enter if the fire exit is closed.
 *
 * Hint: Use short-circuiting and short-circuiting with if-else to solve this exercise.
 */
fun isSafeToEnter(buildingOnFire: Boolean, fireExtinguisherAvailable: Boolean, fireExitOpen: Boolean): Boolean {

    return !buildingOnFire || (buildingOnFire && fireExtinguisherAvailable && fireExitOpen)
}