If a part of this segment overlaps with the given range
left = query ( 2 * index + 1 , beg , mid , l , r ) NEW_LINE right = query ( 2 * index + 2 , mid + 1 , end , l , r ) NEW_LINE if ( left . max_set_bits > right . max_set_bits ) : NEW_LINE INDENT result . max_set_bits = left . max_set_bits NEW_LINE result . value = left . value NEW_LINE DEDENT elif ( right . max_set_bits > left . max_set_bits ) : NEW_LINE INDENT result . max_set_bits = right . max_set_bits NEW_LINE result . value = right . value NEW_LINE DEDENT else : NEW_LINE INDENT result . max_set_bits = left . max_set_bits NEW_LINE result . value = max ( right . value , left . value ) NEW_LINE DEDENT