質問編集履歴
1
本物に近いコードに修正したため。(そのまま掲載したいのですが、事情的に難しいので。申し訳ありません。)
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,27 +6,41 @@
|
|
6
6
|
|
7
7
|
```ここに言語を入力
|
8
8
|
|
9
|
+
var hairetu =[[1,2,3],[1,3, 4],[1,4, 8],[1,5, 8]....];
|
9
10
|
|
11
|
+
var second_hairetu = [[1,5],[1,6],[2,8]...];
|
10
12
|
|
11
|
-
var key_add=[
|
13
|
+
var hairetu_key_add = []
|
12
14
|
|
15
|
+
for(var i = 0; i<hairetu.length;i++){
|
16
|
+
|
17
|
+
hairetu_key_add.push({
|
18
|
+
|
13
|
-
|
19
|
+
a: hairetu[i][0],
|
20
|
+
|
21
|
+
b: hairetu[i][1],
|
22
|
+
|
23
|
+
c: hairetu[i][2],
|
24
|
+
|
25
|
+
});
|
26
|
+
|
27
|
+
}
|
14
28
|
|
15
29
|
var kari = [];
|
16
30
|
|
17
|
-
zen_hairetu
|
31
|
+
var zen_hairetu = [];
|
18
32
|
|
19
|
-
for(var i=0; i<a.length; i++){
|
33
|
+
for(var i=0; i<hairetu.length; i++){
|
20
34
|
|
21
|
-
kari= key_add[i];
|
35
|
+
kari= hairetu_key_add[i];
|
22
36
|
|
23
|
-
var first_check = hairetu[i][0];
|
37
|
+
var first_check = second_hairetu[i][0];
|
24
38
|
|
25
|
-
var second_check = hairetu[i][1];
|
39
|
+
var second_check = second_hairetu[i][1];
|
26
40
|
|
27
|
-
if(kari.a
|
41
|
+
if(kari.a=== first_check && kari.b=== second_check){
|
28
42
|
|
29
|
-
zen_hairetu.push(kari.
|
43
|
+
zen_hairetu.push(kari.c);
|
30
44
|
|
31
45
|
}
|
32
46
|
|