diff --git a/ArrayChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ArrayChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ArrayChallenge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ArrayChallenge/ShoppingList.swift b/ArrayChallenge/ShoppingList.swift index 646e1db..81409fd 100644 --- a/ArrayChallenge/ShoppingList.swift +++ b/ArrayChallenge/ShoppingList.swift @@ -8,15 +8,15 @@ class ShoppingList { - - func createShoppingList(withItems items: [String], amountOfEachItem amounts: [String]) -> [String] { - - // Implement this function + var updatedShoppingList: [String] = [] - - + for (i, item) in items.enumerated(){ + updatedShoppingList.append("\(i + 1). \(item)(\(amounts[i]))") + } + return updatedShoppingList } - + } +