I am trying to solve this problem RRANGE but cannot get an efficient approach with segment trees. I know I have to build the segment tree for the difference sequence but am unable to frame the complete logic. Can anybody help me to solve this one ?
↧