题目描述:求数组中只出现一次的数字import Foundation class For40Solution { func appearOnce(_ nums: [Int]) -> Int { var n = nums[0] for i in 1..<nums.count { n ^= nums[...
题目描述:求二叉树的深度。import Foundation class For39Solution { func treeDepth(_ root: TreeNode?) -> Int { if root == nil { return 0 } return max(treeDepth...