Skip to content

Commit

Permalink
[Swift 4.2] Updated Linear Search
Browse files Browse the repository at this point in the history
The code worked fine in Xcode 10. I removed code snippet at the top of playground file.
  • Loading branch information
heyrahulrs authored Oct 23, 2018
1 parent a31bd41 commit eab8582
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Linear Search/LinearSearch.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
//: Playground - noun: a place where people can play

// last checked with Xcode 9.0b4
#if swift(>=4.0)
print("Hello, Swift 4!")
#endif

func linearSearch<T: Equatable>(_ array: [T], _ object: T) -> Int? {
for (index, obj) in array.enumerated() where obj == object {
return index
Expand Down

0 comments on commit eab8582

Please sign in to comment.