Traverse merged [ ] to find Kth smallest element using Linear search .
for j in range ( n ) : NEW_LINE INDENT if k <= abs ( merged [ j ] . e - merged [ j ] . s + 1 ) : NEW_LINE INDENT return merged [ j ] . s + k - 1 NEW_LINE DEDENT k = k - abs ( merged [ j ] . e - merged [ j ] . s + 1 ) NEW_LINE DEDENT if k : NEW_LINE INDENT return - 1 NEW_LINE DEDENT