I am getting wrong answer for this logic
i have used sorted array
largest sum : difference between the first and last elements
and for the smallest sum : difference between the adjacent elements
Also i had a doubt can we use different A and B array for the largest and smallest sums?