solution to zigzagLevelOrder