We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a606ed0 + eab8582 commit 569ad22Copy full SHA for 569ad22
Linear Search/LinearSearch.playground/Contents.swift
@@ -1,10 +1,5 @@
1
//: Playground - noun: a place where people can play
2
3
-// last checked with Xcode 9.0b4
4
-#if swift(>=4.0)
5
-print("Hello, Swift 4!")
6
-#endif
7
-
8
func linearSearch<T: Equatable>(_ array: [T], _ object: T) -> Int? {
9
for (index, obj) in array.enumerated() where obj == object {
10
return index
0 commit comments