I know the problem GCAC was not that difficult and implementation based. But what if the constraints of N and M were quite high?? Also, it was mentioned in the problem that the students enter the placement in order i.e. 1,2,3,…,N and if any student’s demands are fulfilled, he(/she) is selected. What if it is not so and after examining all the students, the company selects the students which demand lowest salary along with fulfilling their criteria!
I think we need to use Priority Queue in this case but am not able to perfectly figure out the solution.
I know I am not at all good with explaining stuff. Hope my questions make sense and feel free to make any edits. Hope to see many people actively participating in discussion