Find First Repeating Element Leetcode Javascript 30