/**
 * This exercise requires you to write a function that checks if a set of ingredients is missing from the pantry.
 * The function should return a list of missing ingredients.
 *
 * @param ingredients Set of strings containing the required ingredients for the recipe.
 * @param pantry Set of strings containing the available ingredients in the pantry.
 * @return List of strings containing the missing ingredients.
 *
 * For example,
 * cookRecipe(setOf("tomatoes", "onions", "garlic", "chili powder"), setOf("garlic", "chili powder"))
 * Output: ['tomatoes', 'onions']
 *
 * Note: The function should handle the case when either the ingredients or the pantry is null. In such cases, it should
 * return null.
 */
fun cookRecipe(ingredients: Set<String>?, pantry: Set<String>?): List<String>? {

    if (ingredients == null || pantry == null) {
        return null
    }
    return (ingredients - pantry).toList()
}
/**
 * This exercise requires you to write a function that checks if a set of ingredients is missing from the pantry.
 * The function should return a list of missing ingredients.
 *
 * @param ingredients Set of strings containing the required ingredients for the recipe.
 * @param pantry Set of strings containing the available ingredients in the pantry.
 * @return List of strings containing the missing ingredients.
 *
 * For example,
 * cookRecipe(setOf("tomatoes", "onions", "garlic", "chili powder"), setOf("garlic", "chili powder"))
 * Output: ['tomatoes', 'onions']
 *
 * Note: The function should handle the case when either the ingredients or the pantry is null. In such cases, it should
 * return null.
 */
fun cookRecipe(ingredients: Set<String>?, pantry: Set<String>?): List<String>? {
/**
 * This exercise requires you to write a function that checks if a set of ingredients is missing from the pantry.
 * The function should return a list of missing ingredients.
 *
 * @param ingredients Set of strings containing the required ingredients for the recipe.
 * @param pantry Set of strings containing the available ingredients in the pantry.
 * @return List of strings containing the missing ingredients.
 *
 * For example,
 * cookRecipe(setOf("tomatoes", "onions", "garlic", "chili powder"), setOf("garlic", "chili powder"))
 * Output: ['tomatoes', 'onions']
 *
 * Note: The function should handle the case when either the ingredients or the pantry is null. In such cases, it should
 * return null.
 */
fun cookRecipe(ingredients: Set<String>?, pantry: Set<String>?): List<String>? {

    if (ingredients == null || pantry == null) {
        return null
    }
    return (ingredients - pantry).toList()
}