Partially overlap Query range partially lies in the segment tree node range
mid = ( s + e ) // 2 NEW_LINE return ( query ( tree , 2 * index , s , mid , l , r , k ) + query ( tree , 2 * index + 1 , mid + 1 , e , l , r , k ) ) NEW_LINE