From 43cedc5b31a875bbbaf81dd86d1a283eb33960fa Mon Sep 17 00:00:00 2001 From: mmmeyers Date: Tue, 10 Apr 2018 08:31:50 -0700 Subject: [PATCH] Done --- ArrayChallenge/ShoppingList.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..9233ea1 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -12,10 +12,15 @@ class ShoppingList { func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] { - - // Implement this function + var list: [String] = [] // new array + for (index, item) in items.enumerated() { + let amount = amounts[index] + let theItem = "\(index + 1). \(item)(\(amount))" + list.append(theItem) + } + return list }