โ† Infosys questions

Find Repeated Element Using HashMap

Filed under Infosys

Given an array of integers, find the first element that repeats in the sequence. If no element repeats, return -1. The solution should utilize a HashMap or Set to achieve optimal time complexity.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Infosys questions

Collected from public candidate posts and coding forums. Updated Nov 2026.