in this code
int C=1;
int end=arr[0].center+arr[0].radius;
for(int i=1;i<N;i++)
{
int srt=arr[i].center-arr[i].radius;
if(end<=srt)
{
C++;
end=arr[i].center+arr[i].radius;
}
}
why this statement is inside the if statement
end=arr[i].center+arr[i].radius;
for suppose
1 1
3 1
4 1
in this the first two circles dont overlap so but the third one does and if this dont satisy my if statement then my end will be 1 circles end only but the 3 circle overlaps with 2 circle i know answer will be correct as c=1 but logic wise its going wrong as per me. can u explain me