its failing one TC…
Can anyone help me solve this question
wait i am sending it
Inputs:
3 6
0 2
1 2
2 2
3 2
4 2
5 2
My Output:
0
2
4
-1
6
-1
Correct Output:
0
2
4
6
8
-1
Yeah I see ,please give me a few minutes, I know the error.
1 Like
ok thnx…let me see 2
in the line while(q.front()<=arrival)…why are u not checking for the queue to be empty???
Yeah you can add that condition if there is segmentation fault.
yeah it passed…thnx for helping me…i will resolve the doubt…