-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
//DISHES
//Each element is a list of strings beginning with the name, followed by ingredients
//Group by ingredient so you can find all the dishes that contain it.
//Only ingredients that are in two or more dishes matter.
//Return an array structured the same way, but with ingredients first and all the dishes after
/*
dishes = [["Salad", "Tomato", "Cucumber", "Salad", "Sauce"],
["Pizza", "Tomato", "Sausage", "Sauce", "Dough"],
["Quesadilla", "Chicken", "Cheese", "Sauce"],
["Sandwich", "Salad", "Bread", "Tomato", "Cheese"]]
groupingDishes(dishes) = [["Cheese", "Quesadilla", "Sandwich"],
["Salad", "Salad", "Sandwich"],
["Sauce", "Pizza", "Quesadilla", "Salad"],
["Tomato", "Pizza", "Salad", "Sandwich"]]
//EC: alphabetical order
Metadata
Metadata
Assignees
Labels
No labels