Find First Repeating Element Leetcode Java