link of code-https://ide.codingblocks.com/s/210046
why code is not workin for two test cases
Maximum circles
Hi @dakshi
as i mentioned in the previous point that sorting on the basis of center point will not work, u will have to sort ur vector on the basis of ending point .(not on the basis of starting point
).
Since in this question u need to follow greedy approach u need to first select the circle which ends first.
here is the updated code.
I have made the vector of end,start point so that there is no need of compare comparator since sort function will sort vector on the basis of first element.
Hope dis will resolve ur doubt.
Pls acknowledge if u feel its resolved. Else feel free to post if some thing is still not clear.