Given two sorted arrays such the arrays may have some common elements. Find the sum of the maximum sum path to reach from beginning of any array to end of any of the two arrays. We can switch from one array to another array only at common elements.
Program:
Reference:
http://www.geeksforgeeks.org/maximum-sum-path-across-two-arrays/