Selecting the triplets such that elements of the pairs ( arr [ 0 ] , arr [ 1 ] ) , ( arr [ 2 ] , arr [ 3 ] ) . . . can be made equal
for ( let i = 0 ; i < N - 3 ; i += 2 ) { document . write ( i + " " + ( i + 1 ) + " " + ( i + 2 ) + " " ) ; }