皆の投稿またはAI解答からも解答例が見つかるかもしれませんよ。

BFE.dev 解答例 - JavaScript コーディング問題
51. 重複要素のある配列で特定要素の次の要素を返す

No solution yet, but you can request it.
We are adding solutions based on the requests.