Q:

Find the maximum sum out of two sorted arrays

There are two sorted arrays A and B of equal length where A is sorted in ascending order and array B is sorted in descending order. 
A = {1, 3, 7, 7, 7, 7}
B = {7, 7, 5, 5, 5, 4}

My task is to find two elements, one from A and other from B, so that their sum is maximum.
There is a constraint that I can choose any element from A but I have to choose the element from B in such an order that the index of the element of array B should be greater than that of the chosen element of A. 
In this case, the maximum sum that can be chosen is 12. I have done it in O(n) by simply iterating from left to right. 
I want to know whether there exists any better and more efficient way to find the sum of those two elements.

A:

We know that the best sum is the largest value among the sequence C obtained by adding A and B pairwise.
A and B are monotonic, but C can be arbitrary, so there is no shortcut, you need to compute the whole of C, and O(N) is optimal.

