+ 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

27th May 2017, 11:27 AM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
8 Answers
+ 12
When pop is encounter first element is removed depending on whether it is front or not . else last element is removed.
27th May 2017, 12:02 PM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
it's actually 221
27th May 2017, 12:03 PM
Prabhu Nithin
Prabhu Nithin - avatar
+ 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
27th May 2017, 12:08 PM
Nikolay Nachev
Nikolay Nachev - avatar
+ 10
is 221 the correct answer?
27th May 2017, 12:02 PM
Nikolay Nachev
Nikolay Nachev - avatar
+ 6
still trying to figure out the no output part....
27th May 2017, 12:47 PM
Nikolay Nachev
Nikolay Nachev - avatar
+ 5
thanks @prabhu nd u r ri8 @ nikolay
27th May 2017, 12:04 PM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
+ 3
@ nikolay thanks again and do u know y code playground doesnt show the output😅
27th May 2017, 12:17 PM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
+ 2
i dont know @nikolay i have never got correct answer in this question even once😅
27th May 2017, 12:03 PM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar