basic version
modify levelOrder by adding a flag for flip
sol of q103