/**
 * This function takes a set of ingredients already available with a chef
 * and a dictionary of new ingredients along with their quantity.
 * It adds the new ingredients to the chef's set only if the quantity mentioned
 * in the dictionary is more than what the chef already has.
 *
 * @param chefSet The set of ingredients already available with the chef.
 * @param ingredientDict The dictionary containing new ingredients as keys
 * and their quantities as values.
 * @return The updated set of ingredients after adding the new ingredients.
 */
fun addIngredients(chefSet: MutableSet<String>, ingredientDict: Map<String, Int>): MutableSet<String> {

    for ((ingredient, quantity) in ingredientDict) {
        if (ingredient in chefSet) {
            continue  // Ignore if the ingredient is already available
        }

        if (ingredient in ingredientDict && quantity > (chefSet.find { it == ingredient }?.let { chefSet.count { it == ingredient } } ?: 0)) {
            chefSet.add(ingredient)  // Adding the ingredient to the chef's set
        }
    }
    return chefSet
}
/**
 * This function takes a set of ingredients already available with a chef
 * and a dictionary of new ingredients along with their quantity.
 * It adds the new ingredients to the chef's set only if the quantity mentioned
 * in the dictionary is more than what the chef already has.
 *
 * @param chefSet The set of ingredients already available with the chef.
 * @param ingredientDict The dictionary containing new ingredients as keys
 * and their quantities as values.
 * @return The updated set of ingredients after adding the new ingredients.
 */
fun addIngredients(chefSet: MutableSet<String>, ingredientDict: Map<String, Int>): MutableSet<String> {
/**
 * This function takes a set of ingredients already available with a chef
 * and a dictionary of new ingredients along with their quantity.
 * It adds the new ingredients to the chef's set only if the quantity mentioned
 * in the dictionary is more than what the chef already has.
 *
 * @param chefSet The set of ingredients already available with the chef.
 * @param ingredientDict The dictionary containing new ingredients as keys
 * and their quantities as values.
 * @return The updated set of ingredients after adding the new ingredients.
 */
fun addIngredients(chefSet: MutableSet<String>, ingredientDict: Map<String, Int>): MutableSet<String> {

    for ((ingredient, quantity) in ingredientDict) {
        if (ingredient in chefSet) {
            continue  // Ignore if the ingredient is already available
        }

        if (ingredient in ingredientDict && quantity > (chefSet.find { it == ingredient }?.let { chefSet.count { it == ingredient } } ?: 0)) {
            chefSet.add(ingredient)  // Adding the ingredient to the chef's set
        }
    }
    return chefSet
}