| 1 | import java.util.Arrays; |
| 2 | public class MinAbsoluteDiff { |
| 3 | public static void main(String args[]) { |
| 4 | int A[] = {4, 1, 8, 7}; |
| 5 | int B[] = {2, 3, 6, 5}; |
| 6 | |
| 7 | Arrays.sort(A); |
| 8 | Arrays.sort(B); |
| 9 | |
| 10 | int sum = 0; |
| 11 | for(int i=0; i<A.length; i++) { |
| 12 | sum += Math.abs(A[i]-B[i]); |
| 13 | } |
| 14 | |
| 15 | System.out.println("min absolute diff of pairs = " + sum); |
| 16 | } |
| 17 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…