diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..cdc7f02 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -12,11 +12,11 @@ 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 } }