Merge Sort Tree - Tutorial

merge-sort-tree
mergesort
segment-tree

#21

Getting same issue with JAVA. Getting TLE after 15-16 cases


#22

I think your code counts no. of elements smaller than or equal to k. To find no. of elements smaller than k, lower_bound must be used instead of upper_bound in the code for query function.