Given a complete (virtual) binary tree, return true/false if the given target node exists in the tree or not. Here, the virtual means the tree nodes are numbered assuming the tree is a complete binary tree.
Example:
1
/ \
2 3
/ \ / \
4 (5)nil 6 (7)nil
doesNodeExist(root, 4); // true
doesNodeExist(root, 7); // false, given the node on #7 is a nil nodeFollow-up:
https://leetcode.com/problems/count-complete-tree-nodes