Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created March 27, 2018 17:44
Leetcode 250 - code review snippet
cur.size = left.size + right.size;
cur.isUnival = (left.IsUnival && right.IsUniVal &&
(root.left == null || (root.left.val == root.val)) &&
(root.right == null || (root.right.val == root.val);
if(cur.isUnival)
{
cur.size += 1;
}
return cur;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment