šŸ’” Maximum Circles

why is this code failing 2 test-cases the output seems to be fine i hv tried using long long int also

If two circles Intersect at a single point i.e. ā€œeā€ of one is same as ā€œsā€ of other, then they are also considered as overlapping circles.

Thus, remove = from the if condition.

Hope, this would help.
If you still have doubts, feel free to ask.

@S18ML0016 sir doing the above change make 4 test-cases fail :sweat_smile:
old code - https://ide.codingblocks.com/s/99268
new code - https://ide.codingblocks.com/s/99297

Also, sort the pairs by there second parameter i.e. e rather with first paramenter i.e. s.

This is because you are finding the maximum non overlapping circles and then subtracting it from total circles to find the minimum circles to remove.

Greedy

If you consider the case given above in the picture, then your code is failing for it.

Do the necessary changes And resolve your doubt.
Hope, this would help.

2 Likes

@S18ML0016 thank you very much sir