Find First Repeating Element Leetcode 1508