/**
 * This function helps firefighters to find if they have all the required equipment before going on a mission.
 * It takes two arguments:
 * - equipmentDict: a map containing the available equipment and their quantities.
 * - equipmentNeeded: a list of required equipment.
 *
 * The function should return a list of missing equipment items that are not present in the equipmentDict.
 */
fun findMissingEquipment(equipmentDict: Map<String, Int>, equipmentNeeded: List<String>): List<String> {

    // Create an empty list to store the missing equipment
    val missingEquipment = mutableListOf<String>()

    // Iterate through each required equipment
    for (item in equipmentNeeded) {
        // Use the '!' operator to check if the equipment is not present in the map or its quantity is 0
        if (!equipmentDict.containsKey(item) || equipmentDict[item] == 0) {
            // Add the missing equipment to the list
            missingEquipment.add(item)
        }
    }

    return missingEquipment
}

// Example usage
val equipmentDict = mapOf("axe" to 2, "hose" to 1, "helmet" to 4, "ladder" to 0)
val equipmentNeeded = listOf("axe", "hose", "extinguisher")

val missingEquipment = findMissingEquipment(equipmentDict, equipmentNeeded)
/**
 * This function helps firefighters to find if they have all the required equipment before going on a mission.
 * It takes two arguments:
 * - equipmentDict: a map containing the available equipment and their quantities.
 * - equipmentNeeded: a list of required equipment.
 *
 * The function should return a list of missing equipment items that are not present in the equipmentDict.
 */
fun findMissingEquipment(equipmentDict: Map<String, Int>, equipmentNeeded: List<String>): List<String> {
/**
 * This function helps firefighters to find if they have all the required equipment before going on a mission.
 * It takes two arguments:
 * - equipmentDict: a map containing the available equipment and their quantities.
 * - equipmentNeeded: a list of required equipment.
 *
 * The function should return a list of missing equipment items that are not present in the equipmentDict.
 */
fun findMissingEquipment(equipmentDict: Map<String, Int>, equipmentNeeded: List<String>): List<String> {

    // Create an empty list to store the missing equipment
    val missingEquipment = mutableListOf<String>()

    // Iterate through each required equipment
    for (item in equipmentNeeded) {
        // Use the '!' operator to check if the equipment is not present in the map or its quantity is 0
        if (!equipmentDict.containsKey(item) || equipmentDict[item] == 0) {
            // Add the missing equipment to the list
            missingEquipment.add(item)
        }
    }

    return missingEquipment
}

// Example usage
val equipmentDict = mapOf("axe" to 2, "hose" to 1, "helmet" to 4, "ladder" to 0)
val equipmentNeeded = listOf("axe", "hose", "extinguisher")

val missingEquipment = findMissingEquipment(equipmentDict, equipmentNeeded)