Please look at the code at this ide https://ide.codingblocks.com/s/139781 two of my test cases are not passing and i am unable to figure it out…Please help
Maximum circle problem in greedy Algo
@kushagrathebest
The approach is wrong. You sorted array c while array r remains same. You are mapping different centers with different radii now and messing up the input.
Take in input the centers and radii of the circles. Find the leftmost and rightmost points of these circles by
left = c[i] - r[i];
right = c[i] + r[i];
Store these left and right as a pair and sort this array of pairs in increasing order of right. Then run the greedy algo.
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.