Symmetric Tree
Leetcode considers this question to be easy, but it was a bit more complicated than that at first for me. Let’s try solving it three different ways: Whenever I can, I always try to do BFS. It seems much more natural. BFS - 1st solution func isSymmetricBFS(_ root: TreeNode?) -> Bool { var queue: [TreeNode?] = [] queue.append(root) while !queue.isEmpty { let temp = queue queue.removeAll() // 🔑 to make sure you don't expand on `nil` nodes — otherwise it would be endless for node in temp where node !...