回答編集履歴
1
調整
answer
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
```javascript
|
2
2
|
const check=a=>{
|
3
3
|
const b=a.map((x,y,z)=>x==Math.max(...z)?"rand"+(y+1):null).filter(x=>x!==null);
|
4
|
-
return (a.length==b.length)?"
|
4
|
+
return (a.length==b.length)?(a.length+"個のデータは同じ値です"):("一番値が大きいのは"+b.join("と")+"です");
|
5
5
|
}
|
6
6
|
console.log(check([1,1,1]));
|
7
7
|
console.log(check([1,2,1]));
|
8
8
|
console.log(check([0,2,2]));
|
9
|
+
console.log(check([1,1,0,1,1]));
|
10
|
+
console.log(check([1,1,1,1,1]));
|
11
|
+
|
9
12
|
```
|