Importance of time run error in test case 1

@Faizan-Ali-1395131367301898
Change the loop condition at Line No. 24 to check whether the queue is empty or not.
while(!q.empty() && q.front()!=ord[i]) .

Make a similar check before popping another element out at Line No. 32.

Run errors occur if you are checking or popping an element out of an empty queue.