+ 4
Please help ,This pop question is killing me😭😭
even the code playground says "no output" but in challenges i face this question where there is no option of "no output" and there is no information in courses either😵😵😵 so please tell me how it works!! https://code.sololearn.com/cM2rt8Y3ph2L/?ref=app
8 Answers
+ 12
When pop is encounter first element is removed depending on whether it is front or not .
else last element is removed.
+ 11
it's actually 221
+ 11
just read a bit it should be.
1. you create a deque 1, 2, 3
2. pop_front removes the first, so you have now 2, 3 in the deque.
3. You cout the front element, so output 2.
4. pop_back removes the last, so now it's only 2 in the deque.
5. Then cout back is 2 and cout size is 1.
6. Total output: 221
+ 10
is 221 the correct answer?
+ 6
still trying to figure out the no output part....
+ 5
thanks @prabhu
nd u r ri8 @ nikolay
+ 3
@ nikolay thanks again
and do u know y code playground doesnt show the output😅
+ 2
i dont know @nikolay
i have never got correct answer in this question even once😅