Maximum Circles Problem(greedy algo)

Can you please help me out with a doubt of mine. I am not able if have to only consider the overlapping of circles in this question or do I also need to consider intersection along with overlapping of circles.

Hey @rahul.gupta03111999
You only have to consider overlapping

HINT
try to think in terms of activity selection problem

SIr, my code is failing 2 test cases. Can you please tell me what’s with it.

You should sort on the basis of starting position of the corcle

Yes,I have done that Sir

You have sorted according to venter of circle but u should sort according to c-r,c+r

I am finding difficulty in solving the problem Sir, can you help me out Sir

Hey @rahul.gupta03111999

This is simple activity selection problem. Consider, for each circle, its beginning at and ending at . Now greedily select activities by sorting them according to their ending.

Check this :https://www.youtube.com/watch?v=XR_pnk0MfVg

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.