Traverse merged . get ( ) o find Kth smallest element using Linear search .
for ( let j = 0 ; j < n ; j ++ ) { if ( k <= Math . abs ( merged [ j ] . e - merged [ j ] . s + 1 ) ) return ( merged [ j ] . s + k - 1 ) ; k = k - Math . abs ( merged [ j ] . e - merged [ j ] . s + 1 ) ; } if ( k != 0 ) return - 1 ; return 0 ; }