回答編集履歴
4
カンニングして修正
answer
CHANGED
@@ -10,18 +10,18 @@
|
|
10
10
|
]
|
11
11
|
|
12
12
|
// 複数存在するかもしれないから配列に保存
|
13
|
-
var
|
13
|
+
var indexes = [IndexPath]()
|
14
14
|
|
15
15
|
var count = 0
|
16
16
|
for array in arrayOfArray {
|
17
17
|
if let existNum = array.index(of: "え"){
|
18
18
|
let indexpath: IndexPath = [count,existNum]
|
19
|
-
|
19
|
+
indexes.append(indexpath)
|
20
20
|
}
|
21
21
|
count += 1
|
22
22
|
}
|
23
23
|
|
24
|
-
print(
|
24
|
+
print(indexes) // => [[0, 3], [2, 3]]
|
25
25
|
```
|
26
26
|
|
27
27
|
もっとスマートな方法を知りたいです。
|
3
誤字訂正
answer
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
|
15
15
|
var count = 0
|
16
16
|
for array in arrayOfArray {
|
17
|
-
if let
|
17
|
+
if let existNum = array.index(of: "え"){
|
18
|
-
let indexpath: IndexPath = [count,
|
18
|
+
let indexpath: IndexPath = [count,existNum]
|
19
19
|
index.append(indexpath)
|
20
20
|
}
|
21
21
|
count += 1
|
2
コード不要部分削除
answer
CHANGED
@@ -17,7 +17,6 @@
|
|
17
17
|
if let exsitNum = array.index(of: "え"){
|
18
18
|
let indexpath: IndexPath = [count,exsitNum]
|
19
19
|
index.append(indexpath)
|
20
|
-
} else {
|
21
20
|
}
|
22
21
|
count += 1
|
23
22
|
}
|
1
誤字訂正
answer
CHANGED
@@ -25,4 +25,4 @@
|
|
25
25
|
print(index) // => [[0, 3], [2, 3]]
|
26
26
|
```
|
27
27
|
|
28
|
-
もっとスマートな方法を
|
28
|
+
もっとスマートな方法を知りたいです。
|