Elegant Swift solution by conforming to Equatable
\nclass Solution {\n    func isSymmetric(_ root: TreeNode?) -> Bool {\n\t\troot?.left == root?.right\n\t}\n}\n\nextension TreeNode: Equatable {\n    public stat
```\nclass Solution {\n    func isSymmetric(_ root: TreeNode?) -> Bool {\n\t\troot?.left == root?.right\n\t}\n}\n\nextension TreeNode: Equatable {\n    public static func ==(lhs: TreeNode, rhs: TreeNode) -> Bool {\n        lhs.val == rhs.val && lhs.left == rhs.right && lhs.right == rhs.left\n    }\n}\n```
['Swift']