Hello @Mrinali_Mangal,
There is no need to check for this condition: ans[k-1].first<v[i].first
As if the second of a circle is smaller than the first of another circle, then it’s first is automatically smaller the first of another circle.
Though it is not causing any error, but it is no use to check for this condition.
Now, coming back to your question,
You are missing one case, that if first of one circle is same as the second of another i.e intersecting each other at one point but without any overlap.
Modification:
if(ans[k-1].second<=v[i].first)
{
ans.push_back(v[i]);
k++;
}
Hope, this would help.
Give a like, if you are satisfied.