static int merge(int arr[], int[] left, int[] right) {
		int l = 0, r = 0, inv = 0;
		while (l < left.length || r < right.length) {
			if (l == left.length) {
				arr[l + r] = right[r];
				r++;
			} else if (r == right.length) {
				arr[l + r] = left[l];
				l++;
			} else if (left[l] > right[r]) {
				arr[l + r] = right[r];
				inv += (left.length - l);
				r++;
			} else if (left[l] <= right[r]) {
				arr[l + r] = left[l];
				l++;
			}
		}
		return inv;
	}