If meeting are as such 4-7 , 4-8, 5-6 . since we have sorted both the arrays the sequence will be 4-6, 4-7 ,5-8 , which and according to this one of the meeting starting at 4 will end at 6 pm although it doesn’t make a huge difference would it not make a difference in any other problem ?
Party Hall Code arrays sorted?
Hey @ranaabhinav50 True , it is a very non intuitive approach when you first look at it . But if you see what is happening is that we know that the starting time will always be less than the ending time for a party.
So they kind of are independent of each other . if a party is ended we definetly know that one of the halls is free now (End[j] < start[i]). And if a party has just started we definetly know that we cannot accomodate the party in the given halls (start[i] < end[j])because all the halls accomodated have active parties in them (c -> active parties ) .
And the maximum parties variable is telling us what is the maximum no of parties happening in one point of time which in turn means the maximum value of c .
Hope it helps 
If you have any further doubts you can ask here or if your doubt is resolved then please mark it as resolved . Thanks 