diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..fa03cf4 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -10,13 +10,15 @@ class ShoppingList { + func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] { - // Implement this function - - + var reconstructedList: [String] = [] + for (index, item) in items.enumerated() { + reconstructedList.append("\(index + 1). \(item)(\(amounts[index]))") + } + return reconstructedList } - }