I recently faced this question in my interview. I proposed my solution by sorting the starting and ending time arrays separately. But the interviewer said how can you sort these arrays separately, they are like a pair.
Can you tell me how should I respond to that?
Sorting related doubt
hello @poojas1607
i think he/she didnt get ur approach. u should have explained that no doubt they are in pair but ur alogorithm will not process them in pair.
u will use two pointers approach. if the starting time is smaller then it means that one new activity is added to platform
and when ending time is smaller that means one activiity is reduced from the platform.
cleary here we dont need to know both the information altogether hence we can sort then individually
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.