By doing an inorder traversal of the given BSTs, we can get the inorder of the merged BST in $O(m)+O(n) = O(m+n).$ Once we have the inorder of the merged BST, we can construct this tree as follows.
- Make the middle element the root
- Make the middle of the left subarray as the left child
- Make the middle of the right subarray as the right child
- Recursively do steps 1-3 until all elements of array are processed
Time complexity of above $=O(m+n)$ as no element is processed more than once.
Thus we get $a = 1, b = 0.$
Correct Answer $=2\times 1 = 2.$