Restaurant Customers cses problem solution -
What was the maximum number of customers?
The first input line has an integer : the number of customers.
After this, there are lines that describe the customers. Each line has two integers and : the arrival and leaving times of a customer.
You may assume that all arrival and leaving times are distinct.
Print one integer: the maximum number of customers.
Step 1- take input in a vector which contain pair of int and bool and insert arrival time as true and leaving time as false.
Step 2- sort the vector.
stem 3- iterate over vector and when you found true update max if max > ans
step 4- else if you strike false update ans as ans-1
Here is code solution -