it works correctly for sample test case, but getting wrong answer while submitting
Level order zigzag
Hey, your code is not the most optimised code.Even if your code is correct you will still get tle.
So try to do it in O(n).
Hint:do level order traversal and for every even level , add right first then left
not getting TLE, it is showing wrong answer
how to implement as you said
and one more question I asked 3 days ago, you haven’t replied yet
Here is my code,just see the implementation: