Hi i need a javascript program which finds the element in the given array of integers which is placed in the array right before the first repeating element.
In this way, for the following example input:
-1 2 5 6 2 9 -1 6 5 6 -1 3
The output should come as 9
In the same way when input is :- 4 2 6 2 5 4
output has to be 6
java !== javascript