Company: Tech Mahindra_
Difficulty: medium
Merge Number Chains Problem Description Tom and Bob each own a number chain : a singly linked list of integers. Their two chains overlap. From some node onward, both chains run through the very same nodes - not through copies that happen to hold equal values, but through one and the same shared run of nodes. That shared run is called the common tail , and the first node that belongs to both chains is the merge point . Tom challenged Bob, blindfolded, to rebuild the two chains into one. Bob must: find the merge point of the two chains; look at the part of each chain that lies before the merge point (its prefix ) and decide which of those two parts is longer; take the chain with the shorter prefix, detach that prefix, and hang it onto the very end of the other chain (the one with the longer prefix, common tail included). If the two prefixes have the same length, Chain1's prefix is appended after Chain2 - that is, Chain2 is treated as the longer chain. Help Bob and print the single c