Do give suggestions about what is wrong

first two test case are failing what is the problem in my code

hi @harshkasana17 this is just like act selection problem, sort no inc order of ending point and chose
refer

#include<bits/stdc++.h>
using namespace std;

class Circle
{

   public:
   int start;
   int end;

   Circle(int s, int e)
   {
       this->start = s;
	   this->end = e;   
   }
};

static bool comp(Circle c1, Circle c2)
{
	if(c1.end == c2.end)
	return c1.start < c2.start;

	return c1.end < c2.end;
}

int main() {

	int n;cin>>n;
    
	vector<Circle> vec;

	for(int i=0;i<n;i++)
	{
		int c,r;
		cin>>c>>r;

		int s = c-r;
		int e = c+r;

		Circle cr(s,e);

		vec.push_back(cr);
	}

	sort(vec.begin(),vec.end(),comp);

	int curr = vec[0].end;
    int cnt=0;

	for(int i=1;i<n;i++)
	{
		if(vec[i].start >= curr)
		{
			curr = vec[i].end;
		}
		else
		{
			cnt++;
		}
	}

	cout<<cnt<<endl;

	return 0;
}

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.