# Build Identical Trees

Given two binary trees T1 and T2, you have to find minimum number of insertions to be done in T1 to make it structurally identical to T2. Return -1 if not possible.

Notes

• Assume insertions are done in a normal fashion in the BSTs.
• Assume while inserting, if the value of a node v is equal to value being inserted, we insert it in left subtree of node v.
• You can insert any positive or negative integer.

Example :

``````Input 1:

T1:       10
/ \
9   20

T2:       5
/ \
2   7
/
1

If you insert 8 into T1, it will be structurally identical to T2. Hence answer is 1.

Input 2:

T1:       10
/ \
9   20

T2:       5
\
7

You cannot make T1 and T2 structurally identical. Hence answer is -1.
``````
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details. Hints
• Hints are not available for this problem
{"ft_lang_label":"__label__en","ft_lang_prob":0.77675426,"math_prob":0.7081189,"size":649,"snap":"2019-43-2019-47","text_gpt3_token_len":193,"char_repetition_ratio":0.10387597,"word_repetition_ratio":0.0625,"special_character_ratio":0.30508474,"punctuation_ratio":0.15753424,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96777093,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-13T19:53:39Z\",\"WARC-Record-ID\":\"<urn:uuid:532d2c93-a50c-416c-8fdf-3f7cb4917e85>\",\"Content-Length\":\"91221\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f0eb4d40-2a84-40e5-ad7b-3971dc15d395>\",\"WARC-Concurrent-To\":\"<urn:uuid:5a70f92f-6db7-4df8-a678-f7dbfcb2cbe0>\",\"WARC-IP-Address\":\"52.41.179.212\",\"WARC-Target-URI\":\"https://www.interviewbit.com/problems/build-identical-trees/\",\"WARC-Payload-Digest\":\"sha1:M2E5H2ULGQ424WQ37WPNDWMS3FWKKPMJ\",\"WARC-Block-Digest\":\"sha1:XVWYOHPVRZ3FKGLUQKMAEITZ6TPDDXI4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496667333.2_warc_CC-MAIN-20191113191653-20191113215653-00435.warc.gz\"}"}