/**
 * This exercise requires the chef to detect a specific ingredient in a recipe and break out of the loop once found.
 *
 * Given a dictionary of recipe ingredients and their quantities, the chef's task is to determine if a certain ingredient is present. If found, the chef should break out of the loop and return true. Otherwise, the chef must continue iterating over the remaining ingredients until the end of the loop.
 *
 * @param chef A dictionary representing the chef with a list of recipe ingredients.
 * @return true If the specified ingredient is found in the chef's recipe, false otherwise.
 */
fun detectIngredient(chef: Map<String, Int>): Boolean {

    val recipe = mapOf("salt" to 2, "pepper" to 1, "sugar" to 3, "flour" to 4, "butter" to 5)
    val ingredientToFind = "salt"

    for ((ingredient, _) in chef) {
        if (ingredient == ingredientToFind) {
            return true
        }
    }
    
    return false
}
/**
 * This exercise requires the chef to detect a specific ingredient in a recipe and break out of the loop once found.
 *
 * Given a dictionary of recipe ingredients and their quantities, the chef's task is to determine if a certain ingredient is present. If found, the chef should break out of the loop and return true. Otherwise, the chef must continue iterating over the remaining ingredients until the end of the loop.
 *
 * @param chef A dictionary representing the chef with a list of recipe ingredients.
 * @return true If the specified ingredient is found in the chef's recipe, false otherwise.
 */
fun detectIngredient(chef: Map<String, Int>): Boolean {
/**
 * This exercise requires the chef to detect a specific ingredient in a recipe and break out of the loop once found.
 *
 * Given a dictionary of recipe ingredients and their quantities, the chef's task is to determine if a certain ingredient is present. If found, the chef should break out of the loop and return true. Otherwise, the chef must continue iterating over the remaining ingredients until the end of the loop.
 *
 * @param chef A dictionary representing the chef with a list of recipe ingredients.
 * @return true If the specified ingredient is found in the chef's recipe, false otherwise.
 */
fun detectIngredient(chef: Map<String, Int>): Boolean {

    val recipe = mapOf("salt" to 2, "pepper" to 1, "sugar" to 3, "flour" to 4, "butter" to 5)
    val ingredientToFind = "salt"

    for ((ingredient, _) in chef) {
        if (ingredient == ingredientToFind) {
            return true
        }
    }
    
    return false
}