Push pair { point [ 1 ] - point [ 0 ] , point [ 0 ] } in pq
pq . push ( [ arr [ point ] [ 1 ] - arr [ point ] [ 0 ] , arr [ point ] [ 0 ] ] ) ; pq . sort ( function ( a , b ) { if ( a [ 0 ] != b [ 0 ] ) return b [ 0 ] - a [ 0 ] ; return b [ 1 ] - a [ 1 ] ; } ) }