HashedIn by Deloitte interview question

Level order traversal