Please help me to solve this - Counts how many times most repeated element in the segment tree.
You can solve this problem using persistent segment tree. You can read more about persistent data structure here
Tnq @ravi0213.