Maximum circles2


what is the error?

You have sorted the coordinates of the circle according to its starting position.
You need to sort it according to the ending position such that more space is left for the remaining circles.( just as in activity selection problems)
After that check for the overlapping conditions : ie. if starting point of next circle < ending point of previous circle then increment the count


Refer to the modified code.
Mark your doubt as resolved if you think your problem has been solved and you got your mistake.

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.

thanks for the help. my doubt is cleared