Driver method
public static void main ( String [ ] args ) { int arr [ ] = { 1 , 2 , 3 , 3 , 4 , 5 } ; int index = findRepeatingElement ( arr , 0 , arr . length - 1 ) ; if ( index != - 1 ) System . out . println ( arr [ index ] ) ; } }