I can give a quick thought about this -
what you try to do is actually draw this ranges but sorted according to the first coordinate,and then start drawing vertical lines on the second coordinate of each range and see how may ranges it intersects and then delete such ranges where minimum intersections happen.
Nope , sorting takes nlogn time and then rest of the work is done by just looking over the second coordinates which also are sorted , (used lower bound for getting the appropriate position) for a better reference you can have a look at my solution, https://www.codechef.com/viewsolution/28339731
i used recursion to achieve this, but couldnt optimise it so i got tle in higher subtasks…
can anyone help mw in optimising this code(also i dont think it has overlapping here, correct me if im wrong) https://www.codechef.com/viewsolution/28343558
Hey I was looking at your solution but didn’t get the proper intuition behind it.
I am stuck at the part where you found no of finish times less than first time of current one (Line 207).
Also,
Could you please tell me how to do this efficiently?