func isSameTree(_ p: TreeNode?, _ q: TreeNode?) -> Bool {
	return p?.val == q?.val ? ( p != nil ? isSameTree(p?.left, q?.left) && isSameTree(p?.right, q?.right) : true ) : false
}

Runtime: 8 ms, faster than 100.00% of Swift online submissions for Same Tree.
Memory Usage: 18.8 MB, less than 27.78% of Swift online submissions for Same Tree.