public class SmallSum { public static void mergeSort(int[] arr) { if (arr == null || arr.length < 2) { return; } mergeSort(arr, 0, arr.length - 1); } static int sum=0; static void mergeSort(int a[],int l,int r) { if(l==r) { return; } int m = l+((r-l)>>1); mergeSort(a, l, m); mergeSort(a, m+1, r); merge(a,l,m,r); } static void merge(int a[],int l,int m,int r) { int[] help = new int[r-l+1]; int p1=l; int p2=m+1; int i=0; while(p1<=m&&p2<=r) { sum+=a[p1]