We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 21d3216 commit 8b3999eCopy full SHA for 8b3999e
lcof/面试题04. 二维数组中的查找/README.md
@@ -224,6 +224,21 @@ public class Solution {
224
}
225
```
226
227
+#### Swift
228
+
229
+```swift
230
+class Solution {
231
+ func findNumberIn2DArray(_ matrix: [[Int]], _ target: Int) -> Bool {
232
+ for row in matrix {
233
+ if let _ = row.firstIndex(of: target) {
234
+ return true
235
+ }
236
237
+ return false
238
239
+}
240
+```
241
242
<!-- tabs:end -->
243
244
<!-- solution:end -->
lcof/面试题04. 二维数组中的查找/Solution.swift
@@ -0,0 +1,10 @@
1
2
3
4
5
6
7
8
9
10
0 commit comments