Getting wrong answer

My sample test cases is passing but getting wrong answer

hello @aman4411
u havent sorted ur list.
first sort ur list and then apply ur logic.

also vector / array will be a better option than list.

I have sorted the activities now based on their starting time and also used array instead of list. still getting wrong answer

sort on basis of ending time

1 Like

yes it worked … Thanks