(TreeNode root, TreeNode p, TreeNode q)
| 23 | } |
| 24 | |
| 25 | public static TreeNode commonAncestor(TreeNode root, TreeNode p, TreeNode q) { |
| 26 | if (!covers(root, p) || !covers(root, q)) { // Error check - one node is not in tree |
| 27 | return null; |
| 28 | } |
| 29 | return commonAncestorHelper(root, p, q); |
| 30 | } |
| 31 | |
| 32 | public static void main(String[] args) { |
| 33 | int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; |
no test coverage detected