Skip to content

Commit 569ad22

Browse files
authored
Merge pull request kodecocodes#806 from rahulrs0029/master
[Swift 4.2] Updated Linear Search
2 parents a606ed0 + eab8582 commit 569ad22

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Linear Search/LinearSearch.playground/Contents.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
//: Playground - noun: a place where people can play
22

3-
// last checked with Xcode 9.0b4
4-
#if swift(>=4.0)
5-
print("Hello, Swift 4!")
6-
#endif
7-
83
func linearSearch<T: Equatable>(_ array: [T], _ object: T) -> Int? {
94
for (index, obj) in array.enumerated() where obj == object {
105
return index

0 commit comments

Comments
 (0)