Python submission gets TLE


#1

Same solution with level order traversal works fine in cpp