Skip to content

Instantly share code, notes, and snippets.

View schalla7's full-sized avatar
๐Ÿ˜Ž

Schalk Sevenster schalla7

๐Ÿ˜Ž
View GitHub Profile
@schalla7
schalla7 / gist:2c6f7b3388dc7f95569e38b9e8377d87
Created October 7, 2024 08:36
python: use set(A) - set(B) to find items that are in A but not in B
#!/usr/bin/env python
# Given a list of ingredients needed for a recipe, represented as strings, and a list of ingredients you have in your pantry,
# write a function to return the minimum number of additional ingredients you need to buy to make the recipe.
# If you want to do some extra credit, add expiration dates to the pantry items, and only account for food that isn't expired.
# Example:
# Input:
# recipe = ["eggs", "flour", "sugar", "butter"]