i am getting tle
Help me out in this problem
Yeah wait…
Replace line 43 by :
if(q.size())
q.push(NULL);
Otherwise queue will never become empty and we only have to push NULL when elements are left to process
If this resolves your query then please mark it as resolved.