Please suggest me missing logic
Sample test case is working but getting wrong answer
there is minute mistake in logic. you should be picking up the activities based on their earliest end times, because the earliest the end time, the more it will give the duration for other activities to be picked up.
so “you must sort the activities based on their end time”, NOT their start time.
updated code: https://ide.codingblocks.com/s/214950
please rate and resolve if satisfied.
thanks
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.