Simple question but can we do it w/o using any map in O(n)?

Revision en1, by NAINAAAA, 2024-06-15 18:10:38

HELLO CF community i'm wondering can we solve below problem w/o using map in O(n)? constraint n < 1e5 & |a[i]| < 1e9

Given an array of integers, find the first repeating element in it. We need to find the element that occurs more than once and whose index of first occurrence is smallest.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English NAINAAAA 2024-06-15 18:10:38 353 Initial revision (published)