Consider a big party where a log register for guest’s entry and exit times is maintained.
You are given two integer entry and exit each of size N where (entry[i], exit[i]) denotes the entry and exit time for guest i.
Find the time at which there are maximum guests in the party.
1 <= N <= 105
1 <= entry[i] < exit[i] <= 106
First argument is an 1D integer array A denoting the entry.
Second argument is an 1D integer array B denoting the exit.
Return a single integer denoting the time at which there are maximum guests in the party.
A = [1, 2, 9, 5, 5] B = [4, 5, 12, 9, 12]
A =  B = 
The input is like: First guest in array arrives at 1 and leaves at 4,second guest arrives at 2 and leaves at 5, and so on. There are maximum 3 guests at time 5.
There is only one guest which arrives at 1 and exists at 3 so the answer can be 1, 2 or 3 but we will output 1(smallest one).
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.