Open kaitlynhwang opened 7 years ago
Chapter 22
/ Bronze Challenge / func filter(f: Element -> Bool) -> Stack { var filteredItems = [Element]() for item in items { if (f(item)) { filteredItems.append(item) } } return Stack(items: filteredItems) }
to func filter(f: (Element) -> Bool) -> Stack
From the README -
Ch. 27 uses Swift 3, all other chapters are in Swift 2.2
Chapter 22
/ Bronze Challenge / func filter(f: Element -> Bool) -> Stack {
var filteredItems = [Element]()
for item in items {
if (f(item)) {
filteredItems.append(item)
}
}
return Stack(items: filteredItems)
}
to func filter(f: (Element) -> Bool) -> Stack