问题描述:

Given two (unsorted) arrays with equal size, a and b. What is the algorithm that minimizes sum(abs(a-b)) by reordering b? The easiest solution is to enumerate all the permutations of array b, but do we have a faster algo, or is this just problem NP hard?

相关阅读:
Top