回答編集履歴

1

修正

2020/01/11 14:01

投稿

Zuishin
Zuishin

スコア28669

test CHANGED
@@ -6,6 +6,6 @@
6
6
 
7
7
  const array = ["a", "b", "c", "d", "e", "e", "b", "e", "c", "a", "d"];
8
8
 
9
- console.log(array.join("").match(/(.)\1+/)[0][0]);
9
+ console.log([...array.sort().join("").matchAll(/(.)\1+/g)].map(a => a[0]).sort((a, b) => b.length - a.length)[0][0]);
10
10
 
11
11
  ```