TC 2 is failing

Pls check Test Case 2 is failing…

Here is my code

we never check the emptiness of a queue using if(q.front()) , as the queue might contain 0 valued elements.
always use empty() method of queue to ensure the queue is not empty.

updated code: https://ide.codingblocks.com/s/215272

please rate and resolve if satisfied.
thanks