Here you can find the source of minimumDotProduct(int[] a, int[] b)
public static long minimumDotProduct(int[] a, int[] b)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static long minimumDotProduct(int[] a, int[] b) { Arrays.sort(a);/*from w w w . ja v a2 s. c o m*/ Arrays.sort(b); long result = 0; for (int i = 0; i < a.length; i++) { result += (long) a[i] * b[b.length - i - 1]; } return result; } }