Wrong Answer. Can't figure out Why
hello @rachitbansal2500
ur comparator is not correct.
u should sort on the basis of right most coordinate of the cirlce (something like activity selection problem).
@aman212yadav but I am trying to count the valid circles by doing max++ only when the circle isn’t overlapping.
yeah u r counting number of non overlapping circles,but in problem they have asked to print number of circle that we remove to make other circle non overlaping.
thats why n-maxx.
Oh ok ok. Thank youu
. You are a life saver.
because here u r modifying ur n.
store it in some variable .and then use that variable in later section of ur code.
ur updated code->
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.