diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..fb2a70a 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -12,11 +12,15 @@ class ShoppingList { func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] { - - // Implement this function - - + // Implement this function + var list: [String] = [] + for (index, item) in items.enumerated(){ + let amount = amounts[index] + let newItem = "\(index). \(item)(\(amount))" + list.append(newItem) + + } + return list } - }