Condition when maximum set bits are equal in both subtrees
else { tree [ index ] . max_set_bits = tree [ 2 * index + 2 ] . max_set_bits ; tree [ index ] . value = Math . Max ( tree [ 2 * index + 2 ] . value , tree [ 2 * index + 1 ] . value ) ; } } }