My code related to Maximum Circles is present at https://ide.codingblocks.com/s/160836. My question is how does changing “return left.second<=right.second;” to “return left.second<right.second;” affects the sort function as in the first case I am getting segmentation fault, where in second case getting all test cases passed.
Doubt in compare function
if you use return left.second<=right.second , then you DON’T swap in 2 cases.
if you use return return left.second<right.second , then you DON’T swap in just 1 case.
In this question , you need to go for this second option as you have rightly done 
I recommend you go through the documentation of inbuilt sort function.
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.