Function to generate the original array from the pair - product array
function constructArr ( pair , n ) { let size = Math . floor ( ( 1 + Math . sqrt ( 1 + 8 * n ) ) / 2 ) ; let arr = new Array ( size ) ;