You are given two arrays of size n. You need to choose the sub-array from the first array and replace it with a corresponding sub-array from the second array. Now, find the maximum consecutive sub-array sum in the modified first array.
Sample Input 1- 2 4 -2 1 2 Sample Output 1- 6
Sample Input 2- 8 -2 2 -3 1 -1 -1 1 0 4 -3 3 3 2 -5 3 4 Sample Output 2- 12