End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
nums.nums[i], compare it with the next three elements nums[i+1], nums[i+2], and nums[i+3].nums[i] is equal to one of these elements, return nums[i] as the repeated element.nums[nums.length - 1].