Suppose you have two arrays and you want to compute the maximum of the addition of the two arrays.

Now you move the second array one field to the right. Now you can compute the maximum again of the intersection ... You can move the secound array $k$ times. I want to find the minimal maximum.
In the Example the maximum would be:
- $12$ for the first
- $13$ for the second
- $14$ for the third
so the first one is the best
Is there a efficient way to compute it or a efficient heuristic? (The faster the better even if it is a acceptable heuristic)
the bruteforce way would be to compute the maximum of all shifts and compare them. But i need to find a faster way (even it is heuristically and not too bad). As an output i only need the number of shifts where the maximum is minimal. I thought about taking the mean of both arrays and add them up and take the first list which has a maximum below or equal to the mean, but this does not work well.