Regarding a programme

In STL section there is a program “Activity selection problem” https://online.codingblocks.com/app/player/176096/content/171028/5280/code-challenge

In this problem I have made a 2d array to input starting and finishing time than I have made an array with all elements as -1 then I have check if the finishing time of an activity matches the starting time of another activity than both the activities will be counted using a counter “c” and to check that one activity should be selected only one time I have applied binary search but still I am getting wrong answer . Can you help me out?

Hello @sarthak_singhal your code may be getting correct answer for the sample test case but your approach is not correct as you have to sort according to the ending time of the meetings so we can keep the record if any previous meeting is going on.
for this you should store them in the vector of pair type.
and in that suppose if any meeting is still ongoing then you will keep its record that this meeting is still ongoing and then you will compare the next meeting’s starting time with the ending time of that ongoing meeting to check if they are not overlaping.

@sarthak_singhal do you want me to share the code for the approach i have shared or will you give a try first?