Skip to content

Commit eab8582

Browse files
authored
[Swift 4.2] Updated Linear Search
The code worked fine in Xcode 10. I removed code snippet at the top of playground file.
1 parent a31bd41 commit eab8582

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Linear Search/LinearSearch.playground/Contents.swift

-5
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)