Code Is Correct but getting WA

Here is the Code of Problem : Maximum Circles , of GREEDY algorithms section
->https://ide.codingblocks.com/s/401772
my code is correct but again & again getting WA . i’m not understanding where am i wrong .

Hey @aotian

   for(int i = 1 ; i < n ; i++){//i from 1
       if(not (prevend > a[i].ss)) ans++ , prevend = a[i].ff ;
   }
   cout << n- ans ; //updated this (Follow this https://youtu.be/XR_pnk0MfVg)

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.

yes , i’ve understood my fault . Now it’s ok .

1 Like