Help me out in this problem



i am getting tle

@KartikKhariwal are u there?

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.