Maximum circles greedy approach


please tell me where am I wrong

add this case to your code.
let say the interval is from 1-5 and 2-4;
intervals are made by (c-r,c+r), c=centre,r=radius;
The two intervals currently considered are overlapping and the end point of the later interval falls before the end point of the previous interval:
In this case, we can simply take the later interval. The choice is obvious since choosing an interval of smaller width will lead to more available space labelled as and , in which more intervals can be accommodated. Hence, the pointer is updated to current interval and the count of intervals removed is incremented by 1.

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.