Explanation : a1, a2 .....................an
b1, b2 .....................bn
In order to find out the largest span, check the
sums of
ai +............aj and bi +..............bj
at each step.
If a1 + a2 = b1 + b2 go on, check a1 + a2 + a3 and b1 + b2 + b3.
If not, then check a2 + a3 and b2 + b3
Similarly a check is done at each of the n places
during traversal. A separate variable has to be
kept that contains the maximum span observed
hitherto
Hence fastest algorithm computes with (~) (n)
time and space.