Hello..
I was solving this problem And i am getting TLE on test 29 but not sure why?
i believe the only reason is using map< pair<int, int>, int> but still the complexity should be log n for insertion and finding the item or am i wrong?..
The code is simple just look for the middle point and add the count of it to answer but not sure if that's the reason.
If anyone can confirm the complexity of using map< pair<int, int>, int> would be nice.
Thanks in advance.