I got wrong answer on pretest 10, but I am unable to find any mistake in my code. Please help me find the mistake. This is my submission
I got wrong answer on pretest 10, but I am unable to find any mistake in my code. Please help me find the mistake. This is my submission
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 153 |
| 2 | nik_exists | 151 |
| 3 | maroonrk | 150 |
| 4 | maspy | 149 |
| 5 | AmShZ | 146 |
| 6 | Um_nik | 143 |
| 7 | Errichto | 139 |
| 8 | adamant | 135 |
| 9 | BledDest | 134 |
| 10 | cry | 130 |
| Name |
|---|



Empty Stack... You are trying pop element from stack while stack is empty :)
Thanks for the reply. But I don't think that such a case should occur.
I have taken care of it in the code. Could you please point out why this could be happening in the code?
Here is a test for you
My output which seems correct to me: pushStack pushQueue pushFront pushStack pushQueue pushFront 3 popStack popQueue popFront 3 popStack popQueue popFront
Stack,Queue and Deck are empty after command 0, so you cannot pop something from them
oh! I missed this part of the question "then empty all containers"!!
I actually solved a tougher problem.
Thanks for pointing that out.