We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0837113 commit 10615dfCopy full SHA for 10615df
Linear Search/LinearSearch.swift
@@ -4,3 +4,7 @@ func linearSearch<T: Equatable>(_ array: [T], _ object: T) -> Int? {
4
}
5
return nil
6
7
+
8
+func linearSearch1<T: Equatable>(_ array: [T], _ object: T) -> Array<T>.Index? {
9
+ return array.index { $0 == object }
10
+}
0 commit comments