Update is_tree_symmetric.py

This commit is contained in:
bt3gl 2023-07-30 15:52:35 -07:00 committed by GitHub
parent 93c8e2abf7
commit d5089d5b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def is_symmetrical(root: Optional[TreeNode]) -> bool: def is_symmetrical(root: Optional[TreeNode]) -> bool:
stack = [(root, root)] stack = [(root, root)]